P2P File Sharing Explained: Send Large Files with No Uploads
Most file-sharing services upload your file to a server, then give the other person a link to download it. That works, but it means your data sits on someone else's cloud, there are size limits, and you wait through two transfers. Peer-to-peer (P2P) file sharing skips the middleman entirely.
How WebRTC connects two browsers
Online Clipboard uses WebRTC, the same technology behind video calls. Two browsers exchange a small amount of connection information (called signaling) through a shared room code, then open a direct data channel between each other. Once connected, bytes flow straight from one device to the other.
Why files are read in 64KB chunks
Loading a 2GB file entirely into memory would crash most browser tabs. Instead, Online Clipboard reads the file in small 64KB slices using the browser's File.slice() API and sends them one at a time. Memory usage stays tiny no matter how large the file is.
Backpressure: not overwhelming a slow receiver
A fast sender can produce data quicker than a slow network can deliver it. To avoid ballooning memory or dropping the connection, the sender watches the data channel's bufferedAmount. When too much is queued, it pauses and waits for the buffer to drain before continuing. This flow control keeps large transfers stable.
The one requirement
Because there's no server storing the file, both people must be online at the same time. Open the P2P File Share, share your room code, and once both browsers connect, drop a file to send it instantly.