I Built a Browser-Based P2P File Transfer Tool Using WebRTC (No Server Upload)

Published: (March 7, 2026 at 03:48 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Overview

Most file‑transfer tools on the internet work like this:

  1. Upload the file to a server.
  2. The server stores it.
  3. 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.

  1. User A opens the tool and creates a session.
  2. A session code is generated.
  3. User B enters the same session code.
  4. A WebRTC connection is established.
  5. Files are transferred directly between the two browsers.
User A

  │ session code

User B


WebRTC connection


Direct file transfer

Once 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:

👉

  1. Open the page on two devices or two browsers.
  2. Share the generated session code with the other party.
  3. 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?

0 views
Back to Blog

Related posts

Read more »

Difference between global & globalThis

Overview global and globalThis both refer to JavaScript's global object, but they differ in scope and compatibility across environments. - global – Node.js‑spe...