Zero-config peer-to-peer file sharing & messaging — no servers, no limits.
🚀 Live Demo · Report Bug · Request Feature
LocalShare is a fully client-side, peer-to-peer file-sharing and messaging web application built with vanilla HTML, Tailwind CSS v4, and JavaScript. It leverages WebRTC via PeerJS to enable devices on the same network to discover each other and transfer files directly — no intermediary server, no file size limits, no data leaves your network.
| Feature | Description |
|---|---|
| Direct P2P Transfers | Files stream device-to-device over encrypted WebRTC data channels |
| Zero-Config Discovery | Devices sharing a public IP auto-discover each other via room registry |
| Corruption-Free Transfers | FNV-1a checksum verification + ordered chunk assembly guarantees file integrity |
| High-Speed Chunking | 256KB chunks with WebRTC backpressure control for maximum throughput |
| Failover Room Host | Automatic host election with seamless failover if the host disconnects |
| Secure Handshakes | Explicit Accept/Reject confirmation before any connection is established |
| Real-Time Transfer Metrics | Live speed, percentage, and byte-count tracking with progress bars |
| Room Chat | Encrypted in-room messaging between all connected peers |
| Manual Peer Connect | Bridge any network via direct Peer ID or QR code scanning |
| Drag & Drop | Native drag-and-drop file selection with multi-file support |
| Smart File Icons | Automatic icon detection for 30+ file types (media, code, archives, apps) |
- Eliminated file corruption: Replaced naive
FileReaderchunking with directArrayBufferslicing, ordered chunk indices, and FNV-1a checksum verification on receive - 256KB chunk size (up from 64KB) for 4× faster transfers
- WebRTC backpressure: Monitors
dataChannel.bufferedAmountto prevent buffer overflow and data loss - MIME type preservation: Files are reconstructed with their original MIME type for proper handling by the OS
- Transfer-complete handshake: Receiver verifies chunk count and checksum before assembling the final Blob
- Removed artificial delays: Replaced
setTimeout(10ms)chunking withrequestAnimationFramefor smooth, non-blocking sends
- Single-target failover architecture: Devices probe one unified room host ID; on collision, they silently fall back to client mode
- Faster room resolution: Ipify lookup with 4s abort timeout and graceful local fallback
- Clean console: Suppressed all expected PeerJS warnings during normal discovery flow
- Reconnection handling: Automatic signaling server reconnect with visual status indicators
- Professional SaaS design: Clean card-based layout with Inter font, consistent spacing, and subtle glass effects
- Toast notification system: Replaced basic popup with animated, typed toast messages (info/success/error/warning)
- Drag-and-drop zone: Visual feedback with scale animation on drag-over
- File type icons: 30+ file extensions mapped to Bootstrap Icons
- Live transfer speed: Real-time MB/s display during sends and receives
- Status indicators: Network dot, device status, and connection count badges
- Responsive grid: 12-column layout that adapts from mobile to desktop
- Dark-mode optimized: Pure black (#000) AMOLED background with cyan/mint accents
- 48 adjectives × 48 nouns × 900 numbers × 16 emojis = 33M+ unique combinations
- Emoji prefix for instant visual identification in peer lists
👉 https://local-share.netlify.app/
# Clone the repository
git clone https://github.com/Infinitode/LocalShare.git
# Navigate into the project
cd LocalShare
# Compile Tailwind CSS v4 (requires Node.js)
npx @tailwindcss/cli -i input.css -o output.css --watch
# Open index.html in your browser or use a local server
npx serve .┌─────────────────────────────────────────────────────────┐
│ Room Discovery │
│ │
│ Device A ──┐ │
│ Device B ──┼──► Room Host (ls-roomhost-{room-id}) │
│ Device C ──┘ │ │
│ ▼ │
│ Registry Roster Broadcast │
│ (peer list sync to all clients) │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ File Transfer │
│ │
│ Sender Receiver │
│ ────── ──────── │
│ 1. Read file as ArrayBuffer │
│ 2. Compute FNV-1a checksum │
│ 3. Send metadata (name, size, │
│ chunks, mime, checksum) │
│ 4. Stream 256KB chunks ──────► Collect by index │
│ (with backpressure) 5. Verify chunk count │
│ 6. Verify checksum │
│ 7. Assemble Blob │
│ 8. Offer download │
└─────────────────────────────────────────────────────────┘
LocalShare queries ipify for your public IP, hashes it into a deterministic #room-id. All devices behind the same NAT share this room.
The first device binds to ls-roomhost-{room-id}. Subsequent devices detect the ID is taken and connect as clients. If the host drops, the next heartbeat triggers a new election.
Every file transfer includes:
- Chunk sequencing — each chunk carries its index
- FNV-1a checksum — computed over the full file before send, verified after assembly
- MIME type — preserved for correct Blob construction
- Completion signal — explicit
transfer-completemessage triggers final verification
- HTML5 — Semantic markup
- Tailwind CSS v4 — Utility-first styling (compiled via
@tailwindcss/cli) - Vanilla JavaScript (ES2022) — No frameworks, no build step for logic
- PeerJS — WebRTC abstraction for data channels
- QRCode.js — Instant QR code generation for peer IDs
- Bootstrap Icons — Icon system
Contributions make the open-source community an amazing place. Any contributions 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
Or simply open an issue with bug reports or suggestions.
LocalShare is released under the MIT License (Modified). See LICENSE for details.
Modified Clause: Derivative works must be clearly distinguished from the original and distributed under a different name.
Made with ❤️ by Infinitode
