What the signaling server does
- Assigns roles: the first peer to join a room becomes the sender, the second becomes the receiver.
- Relays WebRTC negotiation messages: the initial offer, the answer, and ICE candidates.
- Issues short-lived TURN credentials when a TURN server is configured.
- Registers short human-readable codes (e.g.
olive-tiger-castle) that map to room IDs.
What the signaling server never does
- Handle file data of any kind.
- Store files, transfer content, or logs of what you send or receive.
- Persist room or peer information after the session ends.
Technical details
Technical details
Transports: Browser clients connect via Socket.IO. CLI clients connect via WebSocket at
/ws. Both share a single in-memory rooms registry (Map<roomId, [peer, peer]>), so browser-to-CLI transfers are fully supported.WebRTC negotiation flow:- Sender joins the room (
join-roomevent) and receives thesenderrole. - When the receiver joins, the server emits
user-connectedto the sender. - Sender creates an SDP offer and sends it via the
signalevent. - Receiver sets the remote description, creates an SDP answer, and sends it back.
- Both peers exchange ICE candidates via
signalevents (trickle ICE). - Once ICE negotiation completes, the WebRTC data channel opens directly between the peers.
POST /api/code with a room UUID. The server picks three random words from a 384-word list and maps them to the room ID with a 10-minute TTL. GET /api/code/:code resolves a code back to its room UUID.TURN credentials: Issued via GET /api/turn-credentials. Credentials use HMAC-SHA1 with a 24-hour expiry. If TURN_SECRET is not set, the endpoint returns STUN servers only.Rate limiting: 30 connections per IP per 60 seconds for Socket.IO and WebSocket; 20 requests per IP per 60 seconds for the TURN credential endpoint.