I Built a Browser-Based P2P File Transfer Tool Using WebRTC (No Server Upload)
Source: Dev.to
Overview
Most file‑transfer tools on the internet work like this:
- Upload the file to a server.
- The server stores it.
- The other user downloads it.
While this approach works, it has several downsides:
- Files are temporarily stored on a server.
- Upload time can be slow for large files.
- It consumes server bandwidth.
To avoid these issues, I built a browser‑based peer‑to‑peer (P2P) file transfer tool using WebRTC. The transfer happens directly between browsers—no server storage, no server upload, and the connection is encrypted.
How It Works
The tool uses WebRTC DataChannels to establish a direct P2P connection between two users.
- User A opens the tool and creates a session.
- A session code is generated.
- User B enters the same session code.
- A WebRTC connection is established.
- Files are transferred directly between the two browsers.
User A
│
│ session code
▼
User B
│
▼
WebRTC connection
│
▼
Direct file transferOnce the connection is established, files move directly between the peers without passing through any central server.
Why WebRTC?
WebRTC is commonly known for:
- Video calls
- Voice chat
- Real‑time collaboration
It also supports DataChannels, which allow browsers to send arbitrary binary data directly to each other. This makes WebRTC ideal for building P2P tools that run entirely in the browser.
Features
- Peer‑to‑peer file transfer
- No server storage or upload
- Direct, encrypted browser‑to‑browser connection
- Session‑code based pairing
- Fully client‑side operation (no installation required)
Try It
You can try the tool here:
👉
- Open the page on two devices or two browsers.
- Share the generated session code with the other party.
- Start transferring files.
Future Directions
I’m also exploring other browser‑based P2P utilities, such as:
- P2P chat
- P2P clipboard sharing
- P2P streaming experiments
- Additional WebRTC utilities
There’s a lot of interesting potential for building more peer‑to‑peer applications that run entirely in the browser.
Feedback
If you try the tool, I would love to hear your feedback. What features would make it more useful?