A peer-to-peer file transfer system that allows you to send files directly between browsers using WebRTC. No account required, no file storage, completely private.
https://drive.google.com/file/d/1cpQsR7knbabYsJgktcLVq6bwRlQawct0/view?usp=sharing
- ✅ Direct P2P Transfer: Files are sent directly between browsers using WebRTC
- ✅ No Storage: Files never touch a server - only signaling messages go through
- ✅ No Account Required: Just share a 6-digit code or scan QR code
- ✅ Encrypted: WebRTC automatically encrypts all data (DTLS)
- ✅ Large Files: Supports files of any size with chunking
- ✅ Progress Tracking: Real-time transfer progress and speed
- ✅ Robust Transfer: Chunk sequence numbers, integrity verification, and error detection
- ✅ Modern UI: Beautiful dark theme with purple/pink accents and grainy textures
- ✅ QR Code Sharing: Scan QR code to automatically join and receive files
- ✅ Room Expiration: Automatic cleanup of expired rooms (10 minutes)
- Node.js (v16 or higher) - Download
- npm (comes with Node.js)
- Modern Web Browser with WebRTC support (Chrome, Firefox, Safari, Edge)
- Install dependencies:
npm install- Start the server:
npm start- Open in browser:
http://localhost:3000
- For network access:
- Use the IP address shown in console (e.g.,
http://192.168.1.2:3000) - QR codes automatically use the network IP
- Use the IP address shown in console (e.g.,
- Sender: Select files and get a 6-digit room code + QR code
- Receiver: Enter the code or scan the QR code
- Connection: WebRTC establishes a direct peer-to-peer connection
- Transfer: Files are chunked and sent directly over the encrypted data channel
- Download: Receiver automatically downloads the files when complete
- Click "Send" mode (default)
- Drag & drop files or click to select
- Share the 6-digit code or QR code with the receiver
- Wait for receiver to join
- Files transfer automatically when connection is established
- Click "Receive" mode
- Enter the 6-digit room code OR scan the QR code
- Wait for connection to establish
- Files download automatically when transfer completes
Create a .env file:
PORT=3000
NODE_ENV=development
ROOM_EXPIRY=600000
MAX_ROOM_SIZE=2Default uses Google's public STUN servers. For different networks, configure TURN server in public/webrtc.js:
const RTC_CONFIG = {
iceServers: [
{ urls: 'stun:stun.l.google.com:19302' },
{
urls: 'turn:your-turn-server.com:3478',
username: 'your-username',
credential: 'your-password'
}
]
};- Port in use: Change
PORTin.envor kill the process using port 3000 - Node.js not found: Install from nodejs.org
- Dependencies missing: Run
npm install
- Ensure both devices are on the same network (for local use)
- Check browser console for errors
- Verify firewall allows WebRTC traffic
- For different networks: Configure TURN server or deploy online
- Verify data channel is open (check connection status)
- Check browser console for errors
- Ensure room hasn't expired (10 minutes)
- Try refreshing and creating a new room
- ✅ HTTPS/WSS: Encrypted signaling channel (when deployed)
- ✅ DTLS: WebRTC automatically encrypts data channel
- ✅ Room Expiration: Rooms expire after 10 minutes
- ✅ No File Storage: Files never stored on server
- ✅ Ephemeral Rooms: One-time use room codes
- ✅ Integrity Verification: SHA-256 checksum validation (when HTTPS available)
tested on helium, chrome, safari, mozilla
bhejo/
├── server.js # Signaling server
├── package.json # Dependencies
├── public/
│ ├── index.html # Main UI
│ ├── style.css # Styles
│ ├── app.js # Application logic
│ └── webrtc.js # WebRTC manager
├── README.md
└── DEPLOYMENT_GUIDE.md # Deployment instructions
MIT
Contributions welcome! Please feel free to submit a Pull Request.
