Keyboard shortcuts

Press ← or → to go to the previous or next page

Press S or / to search the docs

Press ? to show this help

Press Esc to hide this help

Guides

Calls and rooms

A call connects two devices in both directions, and a room connects several. Both run directly between the devices, with no server in the middle. They are conventions over broadcasts, and neither adds a new kind of connection.

In short

irl call                             # prints this side's ticket and waits
irl call <TICKET>                    # on the other machine
irl room --display-name alice        # opens a room and prints its ticket
irl room --display-name bob <TICKET> # joins it

Make a one-to-one call and Run a room have the Rust programs. The rest of this page explains how both work.

Calls

In a one-to-one call, each side publishes one broadcast at live/<endpoint id>/call and subscribes to the other’s. The call broadcast starts visible to nobody. Ringing a peer adds it to the broadcast’s audience, and the peer sees the path appear in its route table. Answering rings the caller back, which shows this side to it, and subscribes to the caller’s side. Hanging up takes the peer out of the audience again, which ends its read.

iroh_live::calls::Calls implements this. Its ticket() names this side, for a peer to call, and next_ring() waits for a peer that rings. irl call and the Android demo use the same convention, so they can call each other. A policy that admits only contacts also keeps strangers from ringing.

Rooms

A room is an iroh-gossip topic. Its members announce themselves and the names of the broadcasts they publish into the room. Each member publishes at rooms/<endpoint id>/<topic>/<name>, to an audience of the current members, and subscribes to the members it wants to show.

  • A room ticket holds the topic and some bootstrap members. Anyone who has it can join and read the room, so it is a secret.
  • A member that leaves, or stops renewing its announcement, drops out, and loses access to the others’ room broadcasts at once.
  • A member that vanishes without leaving stays listed until its lease runs out, about two minutes after its last renewal (see Run a room). If this node had a direct session with the member, the member turns Disconnected when the last session closes, which is sooner.
  • Every member that shows every other member subscribes to all of them. There is no server that mixes or forwards, so rooms suit small groups.

Rooms live in the iroh-live-rooms crate, behind the rooms feature of iroh-live. They know nothing about media.

Where to go next