P2P file transfer: a straight line instead of a detour
Uploading a file to a server just to download it again makes the data take the long way around. P2P makes it a straight line.
What relayed transfer costs
The familiar path is upload to a server, then download from it. That brings four costs: storage and egress bills that scale linearly with volume; bandwidth spent twice, so total time roughly doubles; a copy of your file left on a third-party machine, widening the privacy boundary; and all the timeout, chunking and resume handling landing on your team.
On a LAN the detour is especially wasteful: two machines on the same switch still send data out to a public server and back.
What P2P changes
P2P transfer has the sender and receiver connect directly, so data moves only between the two ends. The server participates in finding the peer and establishing the session, never in carrying the payload.
Three things follow: bandwidth cost shifts back to the two endpoints' own networks; on the same network speed approaches the link limit; and no third-party device retains the file.
Large files are the real test
The webrpc transport organizes data in blocks around 10MB by default, which makes multi-GB transfers markedly steadier than one long connection.
- Chunked transfer: split the file and push blocks in parallel to avoid single-connection timeouts
- Resume: after a drop, continue from completed blocks instead of restarting
- Concurrent streams: multiple blocks in flight to saturate available bandwidth
- Integrity checks: verify blocks after transfer to catch silent corruption
How integration looks
In practice you need a send endpoint and a receive endpoint: the sender opens the file and reads block by block, the receiver writes and verifies blocks, and the data channel established by the SDK carries them. Connection setup, encryption and reconnect stay inside the library, so your code only owns ordering and integrity.
If you want a complete drive rather than raw transfer, MyWebDisk is the reference implementation — it layers directories, preview, editing and permissions on top of this transport.
Want to see a complete implementation?
MyWebDisk: a personal cloud built on webrpcFAQ
Does P2P file transfer need a public IP?
No. Once hole punching succeeds the peers connect directly, which works on most home broadband and office networks.
Can it handle large files?
Yes. Block-based transfer with resume keeps multi-GB transfers stable and avoids restarting from zero after a timeout.
Are files stored on a server?
No. The service only handles signaling and session setup; file data flows directly between the two endpoints.
What limits speed?
On the same network you approach the LAN link limit; across the internet it follows the uplink available at each end.
Is the transfer encrypted?
Yes. Sessions are end-to-end encrypted by webrpc, so a third party on the path cannot reconstruct the file.
Related articles
- WebRTC File Transfer Alternative for App Teams
- Personal NAS SDK: Transport Layer for Self-Hosted Drives