Skip to content
LinkPeek Documentation

Realtime Fabric

The realtime fabric powers live updates across Capture, Payload, Retry, Scanner, and Tunnel labs. It exposes a WebSocket endpoint that broadcasts events on dedicated channels.

Flow diagram showing a frontend subscriber authenticating to the LinkPeek realtime hub and receiving channel updates for capture, payload, retry, scanner, and tunnel topics.

Establish a WebSocket session, subscribe to the topics you need, and process broadcasts as the realtime fabric fans them out.

  1. Authenticate in the UI or call the session API to obtain a token.
  2. Open a WebSocket connection to wss://<host>:9009/realtime?token=<session>.
  3. Send a JSON payload specifying the channels to follow, for example:
{ "op": "subscribe", "topics": ["log.event", "payload.list", "tunnel.status"] }

The server responds with a confirmation event for each subscription.

TopicDescription
log.eventSystem-level audit log showing auth and config changes.
capture.activityNew capture payloads and replay actions.
payload.listPayload uploads, variant creation, and download counters.
retrylab.statsMetrics updates for active retry scenarios.
scanner.jobsJob lifecycle updates, run completions, and diff signals.
tunnel.statusCloudflared heartbeat, hostname, and restart counters.

Include an optional scopes field in the subscribe message to limit noise:

{
"op": "subscribe",
"topics": ["payload.list"],
"scopes": { "payloadId": "123" }
}

When scopes are present, LinkPeek only emits events whose metadata matches the provided keys.

Some topics emit a snapshot payload immediately after subscription. Use this to seed UI state before delta events arrive. Snapshots contain the same schema as individual events, with the snapshot boolean flag set to true.

Implement exponential backoff and resubscribe to topics after any disconnect. LinkPeek invalidates idle sessions, so keep-alive pings ({"op":"ping"}) every 30 seconds help avoid timeouts.

Environment variablePurpose
REALTIME_ENABLEDSet to 0 to disable WebSocket support entirely.
REALTIME_TOPIC_LIMITMaximum number of simultaneous subscriptions per client. Default 32
REALTIME_ORIGINSComma-separated allowed origins for WebSocket upgrades.

Monitor the WebSocket health by tailing linkpeek logs or subscribing to the log.event stream, which records connect and disconnect events alongside client metadata.