Skip to main content

Client Real-Time Data Socket

The ResQueServe Desktop application exposes a local socket API that allows external applications to receive real-time events from the application.

Updated over 2 months ago

Quick Start

Find Your Socket Path

The socket path depends on your operating system and application branding:

macOS:

  • ResQueServe: ~/Library/Application Support/resqueserve-desktop/runtime/data.sock

  • SIM Dispatcher: ~/Library/Application Support/simdispatcher-desktop/runtime/data.sock

Linux:

  • ResQueServe: $XDG_RUNTIME_DIR/com.xenbit.resqueserve/data.sock or /tmp/com.xenbit.resqueserve/data.sock

  • SIM Dispatcher: $XDG_RUNTIME_DIR/com.xenbit.simdispatcher/data.sock or /tmp/com.xenbit.simdispatcher/data.sock

Windows:

  • ResQueServe and SIM Dispatcher: \\.\pipe\com.xenbit.resqueserve.data

Note: Custom socket paths can be configured in the application settings. Check your config.json file for a socketPath property if the default path doesn't work.

Connect to the Socket (C# Socket Client Minimal Example)

using System;
using System.IO;
using System.Net.Sockets;
using System.Text;
using System.Text.Json;

class Program
{
static void Main()
{
// Change to "simdispatcher" if needed
var socketPath = GetSocketPath("resqueserve");

Console.WriteLine($"Connecting to: {socketPath}");

var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);
socket.Connect(new UnixDomainSocketEndPoint(socketPath));

Console.WriteLine("Connected! Listening for events...\n");

var stream = new NetworkStream(socket);
var reader = new StreamReader(stream);

while (true)
{
var line = reader.ReadLine();
if (line == null) break;

var msg = JsonDocument.Parse(line);
var type = msg.RootElement.GetProperty("type").GetString();

if (type == "event")
{
var eventName = msg.RootElement.GetProperty("event").GetString();
var data = msg.RootElement.GetProperty("data");

Console.WriteLine($"Event: {eventName}");
Console.WriteLine($"Data: {data}\n");
}
}
}

static string GetSocketPath(string app)
{
var brand = app.Contains("simdispatcher") ? "simdispatcher" : "resqueserve";

if (OperatingSystem.IsWindows())
return $"\\\\.\\pipe\\com.xenbit.{brand}.data";

if (OperatingSystem.IsMacOS())
{
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
return $"{home}/Library/Application Support/{brand}-desktop/runtime/data.sock";
}

// Linux
var xdg = Environment.GetEnvironmentVariable("XDG_RUNTIME_DIR");
return xdg != null
? $"{xdg}/com.xenbit.{brand}/data.sock"
: $"/tmp/com.xenbit.{brand}/data.sock";
}
}

Protocol Specification

Message Format

All messages are sent as newline-delimited JSON (NDJSON). Each message is a complete JSON object followed by a newline character (\n).

{"type":"event","event":"workplace-updated-current","data":{...},"timestamp":"2025-12-11T10:30:00.000Z"}

Message Types

Connection Message

Sent immediately upon successful connection.

{
"type": "connected",
"timestamp": "2025-12-11T10:30:00.000Z",
"socketPath": "/path/to/socket",
"version": "1.0.0",
"platform": "darwin"
}

Event Message

Sent when an event occurs in the application.

{
"type": "event",
"event": "event-name",
"data": { /* event-specific data */ },
"timestamp": "2025-12-11T10:30:00.000Z"
}

Available Events

workplace-updated-current

Emitted whenever the current workplace of the user is updated or changed.

Event Data: Complete IWorkplace object

Example:

TBA

Use Cases:

  • Monitor the workplace status

  • Update real status LED (blue, red, yellow, green)

Data Model: See the complete IWorkplace API Reference for all available properties and data types.

Did this answer your question?