P2P File Transfer Between Devices
Direct device-to-device streaming powered by WebRTC. Share documents, media, and folders without uploading to cloud servers.
What Is Peer-to-Peer File Transfer?
Peer-to-peer (P2P) file transfer is a decentralized communication architecture where two computing devices communicate and exchange binary data directly with each other, rather than through an intermediary central file server.
In a traditional client-server file sharing setup, Device A uploads the entire file to a remote cloud storage provider (such as Google Drive, Dropbox, or AWS S3). The server stores the file, generates a link, and Device B later downloads it from that server. In contrast, ShareOnline establishes a direct pipe between Device A and Device B: file bytes stream straight from browser to browser.
How ShareOnline Uses WebRTC for P2P Sharing
ShareOnline leverages the WebRTC (Web Real-Time Communication) standard natively supported in modern web browsers. When you initiate a transfer:
- Signaling Phase: Both browsers connect to a lightweight signaling relay to exchange SDP (Session Description Protocol) session parameters and ICE (Interactive Connectivity Establishment) network candidates.
- NAT Traversal: Browsers discover their public-facing network endpoints using public STUN (Session Traversal Utilities for NAT) servers.
- Direct DataChannel: Once connection paths are established, an encrypted SCTP DataChannel is opened directly between both browsers.
- In-Memory Streaming: The sender reads the local file in 32 KB binary chunks and sends them across the DataChannel. The receiver buffers the chunks in memory and triggers a local file download when transfer concludes.
Why P2P File Transfer Differs from Cloud Storage
The fundamental difference lies in file custody and data retention:
- Zero Remote File Storage: Your files never touch a hard disk, database table, or storage bucket on ShareOnline servers.
- Immediate Privacy: There is no persistent public URL left on the web that strangers or indexing bots could stumble upon later.
- Local Network Speed: When both devices are on the same local Wi-Fi, WebRTC can stream directly over the local network, reaching speeds exceeding typical internet upload limits.
What Happens During a Transfer?
Both devices must maintain an active browser session during the transfer. Because there is no intermediary storage server to buffer the file on your behalf, both the sender and the receiver must be connected concurrently. If either participant closes their browser window, the live connection closes and the transfer stops.
Security and Encryption Properties
WebRTC mandates cryptographic security by specification. All DataChannel traffic is encrypted end-to-end using Datagram Transport Layer Security (DTLS). Intermediary network routers and signaling servers cannot inspect or tamper with the payload of the transmitted file.