Sometimes it goes through our relay
Some networks can't connect directly to each other. This is common on mobile data and office networks.
Then the sender can allow our relay. If the relay is available, the file goes through it instead, still locked.
The relay can't open the file and doesn't keep it.
It sees the internet address of each device and roughly how big the file is.
The route the traffic takes
Through our relay
When the sender allowed it, the relay is available and nothing has connected 3 seconds after the recipient answers, the browsers add our TURN relay in Stockholm. Unless a direct route still wins, the encrypted traffic then goes through the relay, over UDP or over TLS on port 443. The relay forwards packets it can't decrypt and doesn't store them.
Relay not allowed
The relay is off unless the sender allows it, for the whole send or for one link when asked. Until then our server gives no relay credentials. A connection with no direct route then waits for the sender to allow the relay if it is available, and fails if not.
When the relay is used
When no direct route works, which is common on mobile data and office networks, the traffic can go through our TURN relay in Stockholm. The relay is off unless the sender allows it. The browsers add the relay only if the sender allowed it before that connection started, the relay is available and nothing has connected 3 seconds after the recipient answers. A page opened before we began adding the relay this way still reserves relay addresses from the start, until it is reloaded.
To add the relay, the browsers start the connection setup again, with a new offer and answer, encrypted just like the first. A direct route can still win after that. So a connection that needs the relay starts about 3 seconds later. A direct route that is still connecting 3 seconds after the recipient answers, for example on a network that loses many packets, may end up on the relay when the sender allowed it.
The relay forwards encrypted packets. It can't decrypt them and doesn't store them.
To use the relay a browser needs credentials, which our server creates only while the sender allows the relay: each time it pairs two pages, and again each time a recipient's page asks after a dropped route, and gives only to the two paired pages. A relay connection can start with them for 5 minutes, and can then run longer. Our server checks every minute that the relay can carry traffic, and offers it once a check passes. The server stops offering it after two failed checks in a row. The relay gets the secret behind the credentials from our server, through the CDN and the load balancer, sealed so that only the relay can open it.
Browsers reach the relay over UDP, or over TLS on port 443 where a network allows only web traffic. The relay forwards only over UDP, and only from its own address. It refuses to forward to other machines on private or internal networks, with one accepted exception: the relay's own box (see decision 0007). It also limits how many relayed connections run at once.
Once the estimated cost of the month's traffic through our relay and, until we deleted the box, our old app box reaches our budget, the relay and our STUN service switch off. They stay off until the month ends, unless we switch them on again sooner, for example by raising the budget. Until then, a new transfer connects only where it can without them, for example on the same local network, and often fails elsewhere.
Allowing the relay
The relay is off unless the sender allows it. Ticking "Use our relay if needed" before sending allows it for that whole send. Otherwise our server gives the send no relay credentials, only the STUN address, so an unmodified browser can't use the relay.
When a link hasn't connected 3 seconds after the recipient answers and the relay is available, the sender's page asks the sender to allow the relay for that one link, with a sound and, if notifications are on, a notification. If the sender has ticked the box by then, the page allows the relay at once instead of asking. Our server told both pages that the relay is available, so the recipient's page waits instead of giving up. When the sender allows it, the page tells our server which link, the recipient's page connects again by itself, and that new connection gets relay credentials. Our server keeps the allowed links in memory while the sender's page is connected and never logs them.
The sender's browser also enforces the choice itself: it starts the connection without relay credentials, whatever our server sends. As a backstop, if the sender's browser still sees a relayed connection, it ends it. The backstop is best effort: a modified recipient can hide that its side goes through a relay.
The limit: a modified recipient can still send its side through our relay with credentials from another pairing, or through any public relay. That recipient has the key anyway. The choice decides which infrastructure carries the encrypted traffic, not who can read the file.