WebSocket relay server for Position-Independent-Agent and Command Center. Pairs agents with relays 1:1 for transparent bidirectional message forwarding.
All endpoints except GET / and /agent require a token. Currently accepted but not validated — any non-empty value works.
https://relay.nostdlib.workers.dev/StatusResponse.https://relay.nostdlib.workers.dev/statushttps://relay.nostdlib.workers.dev/disconnect-all-agentsagent_connected to all event listeners.wss://relay.nostdlib.workers.dev/agentwss://relay.nostdlib.workers.dev/relay/{agentId}wss://relay.nostdlib.workers.dev/eventsOn connect: { "type": "agents", "agents": AgentStatus[] }
| Field | Type | Description |
|---|---|---|
| ip | string | Client IP address |
| country | string | ISO country code |
| city | string | City name |
| region | string | Region / state |
| continent | string | Continent code (NA, EU, ...) |
| timezone | string | IANA timezone |
| postalCode | string | Postal / ZIP code |
| latitude | string | Geographic latitude |
| longitude | string | Geographic longitude |
| asn | number | Autonomous System Number |
| asOrganization | string | AS organization name |
| userAgent | string | Client User-Agent header |
| requestPriority | string | Request priority hint |
| tlsVersion | string | TLS version (e.g. TLSv1.3) |
| httpVersion | string | HTTP protocol (e.g. h2) |
| Field | Type | Description |
|---|---|---|
| id | string | Unique agent identifier |
| connectedAt | number | Connection timestamp (Unix ms) |
| paired | boolean | Whether a relay is currently paired |
| pairedRelayId | string | null | Paired relay ID |
| messagesForwarded | number | Total messages forwarded |
| lastActiveAt | number | Last activity timestamp (Unix ms) |
| ...plus all AgentMetadata fields | ||
| Field | Type | Description |
|---|---|---|
| id | string | Unique relay identifier |
| connectedAt | number | Connection timestamp (Unix ms) |
| pairedAgentId | string | ID of the paired agent |
| Field | Type | Description |
|---|---|---|
| id | string | Unique listener identifier |
| connectedAt | number | Connection timestamp (Unix ms) |
| ip | string | Client IP address |
| country | string | ISO country code |
| city | string | City name |
| region | string | Region / state |
| continent | string | Continent code |
| timezone | string | IANA timezone |
| asn | number | Autonomous System Number |
| asOrganization | string | AS organization name |
| userAgent | string | Client User-Agent header |
| tlsVersion | string | TLS version |
| httpVersion | string | HTTP protocol |
| Field | Type | Description |
|---|---|---|
| agents | { count, connections: AgentStatus[] } | Connected agents |
| relays | { count, connections: RelayStatus[] } | Connected relays |
| eventListeners | { count, connections: EventListenerStatus[] } | Connected event listeners |
ping text frames; the server auto-responds pong (works during hibernation)ping every 30s to all connections/relay/:agentId returns 404 if the agent doesn't exist/relay/:agentId returns 409 if the agent already has an active relay