The file goes straight to them, locked
When the networks allow it, the file goes straight from your computer to theirs. It stays locked the whole way.
Their browser unlocks it and checks that it is exactly the file you sent.
Like on a video call, each device can see the other's internet address.
The route the traffic takes
Direct, on the same network
When both browsers are on the same local network, they connect over their local addresses. The file goes straight between them, and our server and relay see none of it. Each browser still asks our STUN service for its public address. A test in our suite puts both browsers on one simulated network and checks that they connect over their local addresses and that nothing leaves that network but the browsers' connections to our server and their STUN requests.
Direct, through public addresses
Each browser asks our STUN service for its public address. The file then goes straight between the browsers over the internet.
How the file travels
Both browsers start with only our STUN service, so WebRTC tries the direct routes first, without the relay. The direct routes go over the local network, or through each side's public address, which the browser learns from our STUN service. The file then goes straight between the browsers. The sender's page shows which route each connection took.
On both direct routes, each browser's request shows our STUN service its public IP address. The two browsers ask at about the same time, so our STUN service can usually tell which two addresses belong together. The browsers add the relay if you allow it, the relay is available and nothing has connected 3 seconds after the recipient answers. The relay can then learn that the two addresses belong together.
On every route, each browser sees the other's IP address, like on a video call.