SYSTEMS / NETWORKING

Direct — Browser-to-Browser File Transfer for Large Files

Peer-to-peer transfer for large files and whole folders: one share link, and the bytes go straight from sender to receiver over WebRTC. The server only introduces the two peers; no file is ever stored.

Public demo

500 — files per batch, each with its own SHA-256

The problem

Sending a large file usually means uploading it to someone else's disk first. Sending it directly is hard: a browser tab has to stream tens of gigabytes without holding them in memory, cross NATs, and say which file failed when one does.

The approach

A Go WebSocket signaling service exchanges SDP offers, answers and ICE candidates and nothing else; sessions live in memory with a TTL behind an interface so Redis can slot in. A control channel carries the transfer protocol (MANIFEST, MANIFEST_ACCEPT, TRANSFER_START, PAUSE, FILE_DONE, TRANSFER_COMPLETE) and a data channel carries chunks with backpressure handling. A batch of up to 500 files streams back to back with folder structure preserved; each file gets its own SHA-256, hashed in a Web Worker, and the File System Access API streams to disk. STUN for NAT traversal with TURN as fallback. A Flutter client speaks the same protocol from a pure-Dart package.

The results

Live web client with QR share links, local history and a diagnostics page that tests the network path without starting a transfer. The 100 GB figure in the repository is a design target, not a measured benchmark.

Stack: Next.js, React, TypeScript, WebRTC, Web Workers, Go, WebSockets, Flutter, Docker