Overview
The WebSocket transport binding is the primary real-time transport for TCF. It uses a simple newline-delimited JSON framing protocol over standard WebSocket connections (ws:// or wss://).
The WebSocket transport binding is the primary real-time transport for TCF. It uses a simple newline-delimited JSON framing protocol over standard WebSocket connections (ws:// or wss://).
Upon connection, the client sends a connect message:
Each TCF message is serialized as a single line of JSON (no pretty printing). Messages are separated by \n (newline). The newline character must not appear within the JSON payload (it must be properly escaped).
Servers may send ping frames. Clients must respond with pong within the heartbeat interval. Failure to respond results in connection termination.
Clients should implement exponential backoff reconnection. After reconnecting, the client sends a new connect message with the previous session_id to resume the session and recover missed messages.