Connections & relays
iroh first reaches the other side through a relay server and any addresses in the ticket, then tries to hole-punch a direct UDP path and moves the traffic there if that works. Neither side needs an open port.
Connection paths
Section titled “Connection paths”serve, fetch and reset print which path each connection uses, and print
again when it switches between the relay and a direct path:
connection to e86045b272 using the relay https://use1-1.relay.n0.iroh.link./connection to e86045b272 switched to a direct path (203.0.113.7:50687)The id is the other side’s short endpoint id, the same one that names its progress bar on the server. Moves between direct addresses (for example, two local interfaces) aren’t reported.
If the relay line is the last one you see, no direct path could be made: for example both sides are behind symmetric NATs, or UDP is blocked. The data is still end-to-end encrypted, but n0’s public relays are rate limited, so large transfers will be slow.
Choosing relays
Section titled “Choosing relays”The [relay] section of the config file applies to
serve, fetch and reset:
[relay]mode = "default" # n0's public relays (also what you get with no [relay] section)[relay]urls = ["https://relay.example.com"] # setting urls implies mode = "custom"Only your relays, for example your own
iroh-relay server.
[relay]mode = "disabled" # no relays at allA transfer only works if the two sides can reach each other directly or by hole punching.
mode |
urls |
Result |
|---|---|---|
| unset | empty | n0’s public relays |
| unset | set | Only your relays (custom) |
"default" |
empty | n0’s public relays |
"custom" |
set | Only your relays |
"custom" |
empty | Error at startup |
"default" / "disabled" |
set | Error at startup |
"disabled" |
empty | No relays |
deaddrop config check shows the relay setting.
Both sides
Section titled “Both sides”The ticket carries the server’s relay URL and its direct addresses. If you
use your own relays, give the server and the client the same urls. With
relays disabled on the server, the ticket has only direct addresses.