Skip to content

17addisonlin/PeerLink_P2P

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

P2P (PeerLink) File Sharing System


Peer-to-Peer File Sharing System

A browser-based P2P file sharing demo using WebRTC data channels with a WebSocket signaling server and a 4-digit PIN pairing flow.
Explore the docs »
English

View Demo   |   Report Bug   |   Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Troubleshooting
  5. Security & Privacy Notes
  6. Roadmap
  7. Contributing
  8. License
  9. Contact
  10. Acknowledgments

About The Project

Product Name Screen Shot

This project is a lightweight peer-to-peer file sharing web app. It uses WebRTC data channels to send files directly between browsers and a small WebSocket signaling server to exchange offers, answers, and ICE candidates. A 4-digit PIN makes pairing simple and prevents cross‑talk when multiple users are online.

(back to top)

Built With

  • Node
  • WebRTC
  • WebSocket
  • HTML5
  • CSS3
  • JavaScript

(back to top)

Features

  • Direct browser-to-browser file transfer via WebRTC
  • 4-digit PIN pairing to connect the right devices
  • Works across tabs or devices on the same network
  • Simple signaling server for offers/answers/ICE candidates
  • Clean, guided UI with “How to Use” steps

(back to top)

Getting Started

Prerequisites

  • Node.js 18+
  • npm (ships with Node.js)

Installation

  1. Clone the repo
    git clone https://github.com/17addisonlin/Peer-to-Peer-File-Sharing-System.git
  2. Install dependencies
    npm install

Running Locally

  1. Start the signaling server
    node server.js
  2. Serve the frontend in a second terminal
    npx serve ./public
  3. Open the URL from serve in two tabs or devices.

(back to top)

Usage

  1. Open the site on two tabs or devices (same Wi‑Fi recommended).
  2. On the receiving device, click Start Receiving to generate a 4‑digit PIN.
  3. On the sending device, enter that PIN, choose a file, and click Send File.
  4. The receiver gets a download link when the transfer completes.
  5. Either side can send again without refreshing.

(back to top)

Troubleshooting

  • “Upgrade Required” in the browser: you opened the WebSocket server directly. Use the static server URL (from npx serve ./public).
  • No connection or file transfer: verify both tabs show “Connected to signaling server” in the console.
  • Works on one machine but not between devices: ensure both devices are on the same network and use the same host IP in the static server URL.
  • Room is full: only two peers can join the same PIN at once.

(back to top)

Security & Privacy Notes

  • Transfers are peer-to-peer; the signaling server never sees the file contents.
  • A 4‑digit PIN is meant for convenience, not strong security. For sensitive files, use a longer PIN or add authentication.
  • For use across the public internet, you will likely need a TURN server.

(back to top)

Roadmap

  • File metadata (name, size, type) shown on receive
  • Progress bar and transfer speed indicators
  • Optional 6‑digit PIN / time‑limited rooms
  • TURN server support for NAT traversal

See the open issues for a full list of proposed features and known issues.

(back to top)

Contributing

Contributions are welcome. If you have improvements or bug fixes, please open an issue or submit a pull request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Addison Lin - LinkedIn

Project Link: https://github.com/17addisonlin/Peer-to-Peer-File-Sharing-System

(back to top)

Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors