What problem does it solve?
WebSocket and streaming features often work in direct connections but silently break when routed through OpenChamber's end-to-end encrypted relay tunnel, because WebSockets cannot send auth headers and the wire format must stay byte-compatible across two implementations.
Core Features & Use Cases
- WebSocket Endpoint Rules: Enforces opening sockets via openRuntimeWebSocket, registering paths in both allowlists, minting oc_url_token before connecting, and preserving origin handling.
- Wire Format Compatibility: Keeps the TypeScript client codec and JavaScript host mirror byte-compatible, including frame types, handshake negotiation, and per-direction encryption counters.
- Reconnect Discipline: Defines exponential backoff, offline/hidden-state long caps, 4xx handling, and interruptible waits for SSE and WebSocket reconnect loops.
- Use Case: When adding a new terminal WebSocket endpoint, follow the checklist to update ALLOWED_WS_PATHS, isUrlAuthWebSocketPath, token minting, and relay-mode testing so the feature works on mobile clients through the tunnel.
Quick Start
Ask the agent to add a new WebSocket endpoint to OpenChamber and verify it works over the encrypted relay tunnel.