How Connections Work
Sessions are end-to-end encrypted using iroh to manage connections. When connecting to other people in a session, they join using a session token like:
toolkit-eNoNycEBwCAIA8CVkIDWcQyY_Uew9z3F_ECMzbKFrmqPHIorIZUmqihX4HLmoh_YP-s4OrjvA1SEEm4
This token only contains an EndpointId of the
session host:
$ echo 'eNoNycEBwCAIA8CVkIDWcQyY_Uew9z3F_ECMzbKFrmqPHIorIZUmqihX4HLmoh_YP-s4OrjvA1SEEm4' \
| base64 -d | crabz -d -f zlib
f4683b319bc073dccd2451f4eff35f50fbfcbf2f43eb657b2a30f357a23d4b9e
Connection Establishment
The EndpointId is a cryptographic identifier
which is used to connect to the host. To establish this
connection, a relay server is used to find your peer and
relay communications to them until a direct peer-to-peer
connection can be established.
Once a direct connection is negotiated, all traffic flows directly between peers over QUIC. The relay is no longer in the path. If a direct connection cannot be established (e.g. due to restrictive NAT), the relay continues to forward encrypted traffic. In either case, the relay server cannot read the contents of your messages because the connection is end-to-end encrypted.
tl;dr: Connections are secure and use a central relay to establish the initial connection until a direct connection between peers in the session can be established.
Protocol Messages
All messages are serialized with
rkyv (zero-copy
deserialization), zlib-compressed, and framed as
[u32 compressed_length][zlib(rkyv payload)]
on each QUIC stream. Permission enforcement is
client-side: each receiver decides what to accept based
on the sender's role.
Handshake
Peer to Host, then Host to Peer| Join / SessionInfo | Peer sends client type (desktop or web) + display name; host responds with the peer list, assigned identity, open replays, and current frame source. |
| PeerAnnounce / MeshHello | Host introduces the new joiner to existing peers, then the joiner establishes direct mesh connections. |
Session Sync
Any peer and All peers| Cursors & Pings | Live minimap cursor positions and map pings shared between all peers. |
| Annotations | ID-based drawing annotations (lines, circles, arrows, freehand, shapes, measurements, ship placements) synced in real time. Supports per-replay and per-tactics-board contexts. |
| Display Overrides | Per-ship range ring and trail visibility overrides. |
| Heartbeat | Sent every 10s per connection. 30s without any message = connection considered dead. |
Replay Streaming
Frame source to All peers| Frames | Draw commands streamed from the current frame source, tagged with a replay ID. |
| Replay Lifecycle | ReplayOpened / ReplayClosed notifications when replays are loaded or unloaded on the host. |
| Playback & Display | Play/pause, speed, and 31 toggleable render options (ship names, range rings, trails, etc.). |
Tactics Boards
Any peer and All peers| Board Lifecycle | TacticsMapOpened / TacticsMapClosed with map image, name, and coordinate metadata. |
| Capture Points | Add, remove, and sync capture points on tactics boards. |
Host Authority
Host / Co-host to All peers| Permissions | Lock or unlock annotations and display settings for regular peers. |
| Roster | UserJoined / UserLeft notifications and co-host promotion. |
| Window Management | Request all peers to open a specific replay or tactics board window. |
| Asset Delivery | Ship/plane/consumable icons and game fonts sent to web clients for rendering. |