Technical Deep Dive

How it works

A complete walkthrough of how FileTransferNow moves a file from the sender's disk to the receiver's disk — across home WiFi, mobile data, corporate firewalls, or different continents — without a server ever seeing a single byte.

FileTransferNow establishes a direct WebRTC connection between two browsers on different networks. The connection is end-to-end encrypted with DTLS. File chunks then stream directly peer-to-peer, never touching the signaling server.

The whole mechanism in one loop — read on for the engineering details.


0. Why this is true P2P (not "AirDrop for the web")

Tools like AirDrop, LocalSend, and Snapdrop only work between devices on the same local network. FileTransferNow uses WebRTC — the same technology powering Google Meet, Discord voice, and Whereby — so it works between any two browsers on the public internet, no matter what network each side is on.

Sender on home WiFi in Mumbai, receiver on coffee-shop WiFi in Berlin? Works. Sender on 5G mobile, receiver behind a corporate firewall? Works. Same machine, two browser windows? Also works. The signaling server only helps the two browsers find each other — the file itself flows directly browser-to-browser, encrypted end-to-end.

1. The signaling handshake (the only server moment)

WebRTC peers can only talk to each other once they've exchanged session descriptions (SDP) and ICE candidates. A lightweight WebSocket server — the only piece of cloud infrastructure in the system — acts as a temporary mailbox for these small text messages. It sees the metadata needed to set up the connection, never the files.

Once both peers have an open RTCPeerConnection, the signaling channel goes idle. From that point on, the two browsers talk directly to each other. Even if our signaling server went offline mid-transfer, the file would keep flowing.

2. NAT traversal — how browsers find each other across networks

Most home and office routers hide their devices behind NAT (Network Address Translation). Two browsers behind different NATs can't just connect by IP — neither knows the other's public address, and routers reject unsolicited inbound packets.

WebRTC solves this with two protocols:

Together these give us ~99% connection success across real-world networks. If both endpoints are unreachable, you can fall back to paranoid mode and exchange the SDP handshake manually (e.g. paste into Signal).

3. Secure UDP transport with DTLS

WebRTC data channels run over SCTP on top of DTLS. Translation: encrypted by default, NAT-traversing UDP. There is no opt-in step for encryption — if a data channel is open, it is end-to-end encrypted. The encryption keys are negotiated directly between the two browsers and never leave them; not even a TURN relay (if used) can decrypt the stream.

const peer = new RTCPeerConnection({
  iceServers: [{ urls: 'stun:stun.l.google.com:19302' }]
});
const channel = peer.createDataChannel('file-payload');
channel.binaryType = 'arraybuffer';

4. Streaming 100GB without crashing the browser

Naively reading a 100GB file into memory is a one-way ticket to a browser crash. We use the File.stream() API to pull the file in chunks, ship each chunk over the data channel, and pause when the outbound buffer fills up.

const CHUNK_SIZE = 16384; // 16 KB — WebRTC's friendly default
const reader = file.stream().getReader();
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  if (channel.bufferedAmount > channel.bufferedAmountLowThreshold) {
    await new Promise(r => channel.onbufferedamountlow = r);
  }
  channel.send(value);
}

5. Writing to disk with OPFS

On the receiver side, each chunk goes straight to the Origin Private File System — a per-origin sandboxed disk that browsers expose via navigator.storage.getDirectory(). OPFS is fast (no IPC roundtrip) and durable, so RAM stays flat even mid-100GB transfer. Bonus: if the connection drops, we can resume exactly where we stopped instead of restarting from byte 0.

const root = await navigator.storage.getDirectory();
const draft = await root.getFileHandle(meta.name, { create: true });
const writer = await draft.createWritable();
await writer.write({ type: 'write', data: chunk, position: offset });

6. Architectural flow

Sender Browser (any network, anywhere) File.stream() → chunks Signaling + STUN/TURN (handshake metadata only) Receiver Browser (any network, anywhere) OPFS write → local disk Direct encrypted P2P data channel (DTLS/SCTP) File bytes never traverse the signaling server — even across continents.

7. Edge cases we handle