How WebRTC Makes Browser-to-Browser File Transfer Possible

You've probably used WebRTC without knowing it — it's the technology behind video calls that run straight in your browser, no plugin required. Nearsend uses the same underlying connection for a different purpose: instead of carrying a live video feed, it carries your files, streamed directly from one device to the other.

It starts as a call, not a file transfer

WebRTC was designed to open a real-time connection — a 'peer connection' — directly between two browsers. That connection can carry audio, video, or a general-purpose data channel. A data channel is what actually moves a file: it splits the file into a sequence of encrypted chunks and streams them across, in order, until the whole thing has arrived.

Two devices don't know how to find each other on their own

Before any of that can happen, both devices need to exchange a small amount of connection information — things like which network protocols and codecs they support. That exchange is called signaling, and it's handled by a small server sitting in the middle. It only ever sees these setup messages, never the file itself, and once the two devices are connected, it isn't part of the conversation anymore.

Getting through routers and firewalls: STUN and TURN

Most devices sit behind a router or firewall that hides their real network address, which is a problem if two devices need to connect directly. STUN servers solve the common case by helping each device discover its own public-facing address, so the other side knows where to connect. Some networks — a strict corporate firewall, certain mobile carriers — block a direct path no matter what. For those cases, a TURN server steps in as a relay: it forwards the encrypted data between the two devices in real time. It's still end-to-end encrypted traffic passing through, not a copy being stored.

Why this matters for privacy

Because the actual file data flows through a data channel — directly between the two devices whenever a direct path is possible, or through an encrypted relay it can't read when it isn't — there's no step where your file sits on a server to be stored, scanned, or left behind. The signaling server that helped the two devices find each other closes out of the picture as soon as its one job is done.

What this looks like in Nearsend

When you pair two devices on Nearsend with a QR code, PIN, or spoken phrase, that pairing step is the signaling handshake described above — it's just designed to be fast and human-friendly instead of typing in connection strings. Once paired, everything you send — files, a whole folder, text, a clipboard item — travels over that direct, encrypted WebRTC data channel.

More from the blog

Related reading

P2P Transfer Secure Transfer Does Sending a File Ever Touch a Server? A Plain-English Breakdown Is Peer-to-Peer File Sharing Safe? Separating Myth From Reality