Signaling

Signaling

Subscribe to tunnel and client events over SSE or WebSocket.


Signaling is the mechanism used to observe tunnel and client state changes in real time. The engine exposes a streaming endpoint over Server-Sent Events and over WebSocket, and SDKs provide helpers to connect and decode events.

Signaling is useful for fleet management, dashboards, automation controllers, and applications that need to discover and connect to resources dynamically.

Transports

The engine exposes an SSE endpoint at /api/sse and a WebSocket endpoint at /api/websocket. Both endpoints accept an authentication token provided through the rstream.token query parameter.

The Go SDK and the CLI support both sse and websocket transport values. The JavaScript SDK Watch helper supports sse and websocket as well.

On WebSocket connections, the engine sends a state.initial event first, containing snapshot arrays of clients and tunnels, and then continues streaming incremental updates.

CLI usage

The CLI subscribes to the stream with rstream events. It can filter event types and can forward selected events as newline-delimited JSON to stdout or as HTTP POST requests to an external endpoint.