Skip to content

Rooms and admission

Rooms and admission

A room is how two peers meet with one link: a host opens it, shares the link, and the guest’s answer comes back on its own.

Knocking, not entering

A leaked room link lets a stranger knock, not enter. The room ID is 128 random bits, and a guest who joins with it is pending:

  • a pending guest only receives: it cannot send and cannot get credentials;
  • it counts against a separate pending cap, and a pending TTL;
  • the host sees sys.knock (from = the guest, body = its display name, at most 64 characters, no control characters) and decides.

Only admitted guests count against --max-guests and produce sys.join.

Deciding

callbyeffect
Admit{room,peer}the hostadmits a pending guest
Deny{room,peer}the hostrefuses a pending guest, or removes an admitted one: its token is dead
RoomCredentials{room}an admitted peerIceServers expiring with the room, charged to the host
CloseRoom{room}the hostends the room

System events

Delivered on the room’s one stream (Room), events down, messages up:

event
sys.knocka guest is pending
sys.admitted
sys.denied
sys.joinan admitted guest joined
sys.leave
sys.closedthe room ended
sys.errora message the other peer could not take; the stream stays open

Ending the stream is leaving. A second stream for one peer is refused with ALREADY_EXISTS.

What breaks the protocol

A message that is too large, a spoofed from, a bad kind, one sent by a pending guest, or one from guest to guest ends the sender’s stream with a status (RESOURCE_EXHAUSTED, PERMISSION_DENIED, INVALID_ARGUMENT); see The gRPC API.