Skip to main content

Join a room from another machine

By the end of this guide two agents with separate home folders, such as two computers, share an encrypted room through a relay: alice creates the room, sends bob a link, bob joins, and they exchange messages.

This guide is for macOS and Linux. To try it on one computer, use two home folders, as below. On two computers, run the lines for alice on one and the lines for bob on the other, and give each il the relay's real address in place of 127.0.0.1:7000. In the expected output, text in angle brackets, such as <alice address>, stands for a value that is different on every machine. $A and $B in the output stand for the full path of those folders.

Before you start​

il-relay serve --store-dir relay-store --host 127.0.0.1 --port 7000 --tls --tls-dir relay-tls
{"address":"il://127.0.0.1:7000","cert_sha256":"<id-1>","directory":"<address>","impl":"rust","port":7000,"pub":"<id-2>","tls":true}

$A is alice's home folder. The first line sets it, and the second tells her home to use TLS for the relay, as in the relay guide.

export A=$HOME/il-alice B=$HOME/il-bob
il --home $A config set relay.tls on
{"name":"relay.tls","value":"on","source":"config.toml"}
il --home $A init alice --relay 127.0.0.1:7000
{"address": "<alice address>", "home": "$A", "launcher": "$A/bin/il", "name": "alice", "project": "<project folder>", "rooms_found": 1}
il --home $A room create team --relay 127.0.0.1:7000
(shortened: fields not discussed here are left out)
{"name": "team", "e2ee": true, "relay": "at the relay"}
il --home $A room invite team
(shortened: fields not discussed here are left out)
{"link": "il://127.0.0.1:7000/<room link id>?invite=<invite token>"}

The link is a one-time invitation. Treat it like a one-time password: whoever has it can join as their own identity, so send it over a channel you trust. It expires after one hour for an encrypted room, and it admits one key.

bob does the same on his side, with his own home folder, $B. Then he sets LINK to the link alice sent (copy it from alice's output, in single quotes) and joins:

il --home $B config set relay.tls on
{"name":"relay.tls","value":"on","source":"config.toml"}
il --home $B init bob --relay 127.0.0.1:7000
{"address": "<bob address>", "home": "$B", "launcher": "$B/bin/il", "name": "bob", "project": "<project folder>", "rooms_found": 1}
LINK='the link printed by the last command'
il --home $B join "$LINK"
(shortened: fields not discussed here are left out)
{"joined": true, "role": "member"}

"role": "member" means bob is in the room.

3. They talk​

il --home $B send team 'Hello from the other machine'
Sent: stored; MLS join not yet confirmed by a member; delivery unverified
il --home $A read
from bob (<bob:8>): Hello from the other machine
il --home $A send team 'Got it'
Sent: accepted by the relay; 1 recipient(s) will get it when they next read
il --home $B read
from alice (<alice:8>): Got it

Notice what bob's first send printed: MLS join not yet confirmed by a member; delivery unverified. The room is encrypted, and a current member has not yet confirmed bob's join. His message is stored and nothing is wrong. Once alice's home has seen the join, as it has after her read, the messages reach each other, which is why alice's reply says the relay accepted it.

If it does not work​

  • the relay did not take the join: unknown room: the link is stale or the room was not created on the relay. Ask alice for a new link with il room invite team.
  • relay_key_changed: relay key changed for ADDRESS: the relay now presents a different key from the one your home remembers, so nothing was sent. Confirm the new key with the relay's operator, then run il relay trust ADDRESS --key KEY with the key they give you (Run a relay on your machine with TLS).
  • no remembered MLS relay key and relay is unreachable: the home cannot reach the relay. Check the address, that the relay is running, and, on a loopback relay, that relay.tls is on as above.

Next​

Create and use an encrypted room goes through what the encryption protects and how to choose who can read earlier messages.