- About the Project
- How It Works
- Security
- Features
- Technology Stack
- Getting Started
- Usage
- Architecture
- Contributing
- License
- Contact
P2PxRelay is an innovative file-sharing solution that leverages WebRTC technology to enable direct peer-to-peer file transfers. By utilizing a relay server to facilitate connections without storing files, P2PxRelay offers a secure, efficient, and serverless approach to file sharing.
P2PxRelay operates by creating a direct peer-to-peer (P2P) connection between two users using WebRTC. Here's how it works:
- File Announcement: The sender announces the file they want to share using the
p2p.pyclient application. This process generates a unique link. - Relay Server: The relay server, written in Node.js, helps in signaling between the peers. It ensures that both parties are aware of each other and can establish a direct connection.
- P2P Connection: Once the connection is established, the file is transferred directly between the sender and the recipient without passing through the server.
- Web Interface: The recipient opens the provided link in their browser, which triggers the WebRTC connection and initiates the file download.
P2PxRelay emphasizes security by design:
- No Server-Side Storage: Unlike traditional file-sharing methods, P2PxRelay does not store files on any server. This reduces the risk of unauthorized access or data breaches.
- End-to-End Encryption: WebRTC inherently supports end-to-end encryption (E2EE), ensuring that the file is encrypted during transmission and can only be decrypted by the recipient.
- Ephemeral Links: The links generated for file sharing are temporary and expire after use, reducing the risk of unauthorized file access.
These features make P2PxRelay a secure and privacy-conscious choice for file sharing.
- 🔒 Secure peer-to-peer file transfer
- 🌐 No server-side file storage
- 🚀 Fast and efficient data transmission
- 🔗 Easy-to-share unique links
- 📱 Cross-platform compatibility
- Frontend: HTML, CSS, JavaScript
- Backend: Node.js, Express
- WebRTC: aiortc (Python)
- Serverless Functions: Netlify Functions
- Networking: aiohttp (Python)
- Python 3.7+
- Node.js 14+
- npm 6+
- A Netlify account
- Clone the repository:
git clone https://github.com/sidinsearch/P2PxRelay.git
- Install Python dependencies:
pip install aiortc aiohttp
- Install Node.js dependencies:
cd functions npm install - Set up your Netlify site and update the
NETLIFY_SITEvariable inp2p.py.
- Start the file sharing process:
python p2p.py /path/to/your/file
- Share the generated link with the recipient.
- The recipient opens the link in their browser to initiate the download.
P2PxRelay consists of three main components:
- Client Application (
p2p.py): Handles file announcement and WebRTC connection establishment. - Relay Server (
relay.js): Facilitates WebRTC signaling and manages shared connections. - Web Interface (
index.html,download.html): Provides a user-friendly interface for file downloading.
The system uses Netlify for hosting and serverless functions, ensuring scalability and ease of deployment.
TransferX is a Windows application that utilizes P2PxRelay for seamless file sharing. It offers a user-friendly interface and powerful features, making it easy to share files across devices without the need for server storage.
Transferx-Demo.mp4
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
