Dev log
How 3RTC works: a watch party without a media server
Most watch party apps route your video, voice and chat through their servers. 3RTC doesn’t: browsers and the desktop app connect directly to each other with WebRTC. Here is how a room is put together, for the curious and for developers.
1. A small mesh, not a server
A room holds up to 4 people, and every person connects directly to every other one: at most 6 connections in a full room. That keeps voice delay low and means nothing you watch or say is relayed by us. The signaling server only introduces people: it hands out 5-digit room codes, passes the WebRTC offers, answers and network candidates between them, and signs tokens. It never carries video, voice, chat or game moves.
2. Two data channels per person
Each connection has a main channel (ordered, reliable JSON, messages kept small) for chat, play and pause, game moves and presence, and a separate bulk channel for files and video. A big file transfer therefore never delays a chat message or a chess move.
3. Streaming a movie file with no upload
When you pick a movie file, it is not uploaded anywhere. Viewers ask for the blocks they need next, and fetch them from the owner and from other viewers who already have them, a small swarm. Every block is checked against the owner’s SHA-256, so a misbehaving peer can’t slip in bad data. Before playing, the app reads the file’s headers (MP4, MOV, MKV, WebM) to tell you whether your browser can play it, pulls subtitle tracks out of MKV files in a background worker, renders Blu-ray (PGS) subtitles with WebAssembly, and can convert Dolby Digital audio that a browser can’t play.
4. Keeping everyone at the same moment
Play, pause and seek are sent to everyone, and people who join late ask for the current state. On top of that, players send a regular heartbeat; anyone who drifts more than 1.5 seconds away is quietly brought back. Music is stricter: a listener only changes speed slightly, by 1 or 3 percent, once it is 150 ms or more off, so songs never sound smeared.
5. Music named by its content
Each song in the shared queue is named by the hash of its bytes. Whoever has the song can serve it, every block is checked, and title, artist, album and cover are read from the file’s own tags (ID3, FLAC, Ogg, MP4, WAV) with strict size limits, since the file came from someone else.
6. Games on a shared state
Ludo, chess and the other games share one pattern: an authority (the host, or the next person if the host is away) runs a pure reducer that accepts or rejects each move and sends the result to everyone. People who join mid-game get the current state; a player who drops out can come back to their own seat.
7. Trust nobody’s claims
- Who is the host comes from the server, never from a message a peer sends; every incoming message has it overwritten.
- Seats are reclaimed only with a token the server signed (HMAC-SHA256), so a dropped connection gets its own seat back and nobody else can take it.
- Chat is turned into text elements, never HTML; links are http(s) only; images are shown only as JPEG, PNG, WebP or GIF; anything else is a plain download.
- Hangout Circle PINs are checked by the server with constant-time comparison, and repeated wrong guesses get an address banned.
- Link previews are fetched by the server only from public addresses on standard ports, re-checked at every redirect.
8. Web and a native desktop app
The web app is React and TypeScript. The Windows app is written in Rust with the GPUI framework and speaks the same protocol, so both join the same rooms. The desktop app adds screen sharing that keeps the picture on the graphics card from capture to encoder, a Game Mode that shrinks the picture before dropping frames on a weak line, and remote control with a password that never leaves the controller’s computer.
9. Two servers, one room
There are two signaling servers in different regions sharing one signing secret. If one is down, apps find the room on the other without losing their seat or host tokens. Since the servers carry no media and almost no state, they run on small cloud machines.
Questions
Does 3RTC see my video or hear my voice?
No. Video, voice, chat, files and game moves travel directly between the people in the room over WebRTC. The server only introduces you.
Why only 4 people per room?
Everyone connects to everyone, so each extra person adds a connection for every other person. Four keeps voice and sync fast on ordinary home internet and phones.
What happens when a direct connection isn’t possible?
The apps try ICE restarts and rebuild broken connections automatically. A network diagnostics panel shows which connections work and why one doesn’t.