Skip to content
LeylineLauncher
Download

Run a relay from your PC

Leyline runs no server of its own now. Parts of this page that needed it (sign-in, the relay, the official realm, the public realm list, the forum) no longer work. What still works.

About one pair of friends in three can't connect straight to each other: their home routers won't let a connection in from outside, even with hole punching. A relay fixes that. Both launchers connect out to the relay, and the relay passes their bytes along. Leyline runs no relays of its own, so relays are run by players. You can make your PC one with a single switch.

Status, 28 Nov 2026: built and tested on one PC (two launchers and a relay inside one test). It has not been tested between two homes yet: that is the owner's test 6 (docs/smoke/unstoppable-owner-tests.md in the repository). Until it passes, treat this as coming.

Turn it on

  1. Settings › Network › Be a node › Carry players: on. This also turns on Be a node (Host page) if it was off. The relay runs while Be a node runs: not while you use the PC or run on battery, if you chose "only while idle and plugged in".
  2. Allow my router to open a port: on. Your router then opens one port for the relay (UPnP, NAT-PMP or PCP; most home routers can). It stays off until you turn it on.
  3. Optional: Your region. Launchers near you pick your relay first. It is your choice; Leyline never works it out from your address.

The line under the switch tells you where you stand:

It saysWhat it means
Relaying for anyone nowYour router opened the port. Your relay's card is out and any launcher can use it.
This PC can relay only for friends on its networkNo port is open from outside. Turn on "Allow my router to open a port", or open one by hand (below). Friends at your own home can still use it.
Waiting for Be a nodeBe a node is off or not open yet.
Carried N joins this weekHow many launchers connected through your relay this week.

Opening a port by hand

If your router can't open a port by itself, forward one TCP port (3340, or the one your relay uses) to this PC in your router's page, then type your-address:port under Settings › Network › Advanced › A port I opened by hand for my relay. A domain name works too (relay.example.org:3340).

What it costs

  • Data: Be a node's own caps cover the relay: most players at once (20 by default, change it on the same card) and MB a day (2048 by default, on the Host page). At the daily cap the relay rests until midnight (UTC). Most connections use the relay only for the few seconds hole punching takes, then go direct; the ones that can't go direct pass all their traffic through it for as long as they play. Carried N joins this week and Be a node's "today" figure (which includes the relay) show what it really used. (TODO(owner): a measured figure per player-hour, after test 6.)
  • CPU and memory: small; it only copies bytes.
  • One TCP port open on your router while it runs. It is closed again when the relay stops (if your router opened it).

What your relay can see

  • Only encrypted bytes. Every connection through it is QUIC encrypted between the two launchers, and inside that, sealed again with both players' keys. Your relay can't read messages, world traffic or anything else, and can't pretend to be either side.
  • The two connection keys (random device keys, not names) and the addresses of the launchers that connect to it, like any server on the internet. Leyline doesn't log or keep them.
  • Your relay's card is public: it names the relay's own key (random, made for the relay, not your Passport), its address and port, your region if you set one, and how busy it is. Nothing ties it to your Passport.

How launchers find relays (no centre)

Each running relay signs a small card (a mesh relay record). Launchers learn cards from:

  1. friends: your friends get your relay's card with your online status, and prefer it;
  2. friends' lists: launchers pass on the signed records they hold, so a card spreads friend to friend;
  3. mirrors: the signed record list on our site and repo (mesh/snapshot.json). Cards there are old, so they are used as a key to look up;
  4. the public lookup network (the Mainline DHT): every 30 minutes your relay puts its current address there under its own key, so a launcher holding an old card finds where it is now.

A card is good for 30 minutes after it is signed. Your launcher keeps the relays it knows, measures how far each one is, and uses the best two: a friend's first, then the nearest and least busy, in your region if you set one. Settings › Network › Advanced lists them (by a short name, never an address).

For the owner: put your relay in the mirrors

While your relay runs and is reachable from anywhere, Settings › Network › Advanced › Copy my relay card copies its signed card. Add it to records in the repo's mesh/snapshot.json (the site build checks the signature). Every launcher that reads a mirror then knows your relay's key and finds its current address on the lookup network, even weeks later.

What's missing

  • Address discovery on the relay (iroh's "QUIC address discovery") needs a TLS name and certificate, which a home PC doesn't have, so community relays on home PCs don't offer it. Hole punching still uses the relay to exchange addresses, and anything that can't punch through goes through the relay. A relay on a server with a domain can run iroh's own iroh-relay program with TLS and be typed as a helper.
  • Not tested between two homes yet (owner's test 6).

These pages are in the repo at docs/leyline. Source