Web Application
LocalFile
LocalFile - P2P file sharing and messaging on your local network.
Local P2P Share - A Next.js-based peer-to-peer file sharing and messaging application for local networks.
Features
- 🔌 Device Discovery: Automatically discover devices on your local network
- 💬 Real-time Chat: Send instant messages to connected devices
- 📁 File Sharing: Share files of any size with other devices
- 🎭 Anonymous: No authentication required - just random device names
- 🔄 Ephemeral Messages: Messages are stored only in the UI and disappear on reload
- 🌐 Local Network Only: All communication happens within your local network
How It Works
- Each device gets a random generated name (e.g., “SwiftFalcon123”)
- The application shows all available devices on your network
- Select a device to start chatting and sharing files
- Share your device name verbally so others can identify you
- Messages are broadcast in real-time but not persisted
- Files are transferred directly through the WebSocket connection
Usage
Connecting to Devices
- Open the app on multiple devices on your local network
- Each device will show a list of other connected devices
- Click on a device name to start a conversation
Sending Messages
- Type your message in the input field
- Press Enter or click “Send”
- Messages appear instantly on both devices
- Note: Messages are not saved - reloading the page will clear all messages
Sharing Files
- Click the paperclip/attachment icon
- Select a file from your device
- The file metadata (name, size, type) is sent to the recipient
- Recipient sees a “Download” or “Cancel” button
- Click “Download” to save the file
- Click “Cancel” to reject the file transfer
Demo / Preview
Technical Details
Architecture
- Frontend: Next.js 15+ with React and TypeScript
- Backend: Custom Node.js server with Socket.io
- Styling: Tailwind CSS
- Real-time Communication: WebSocket (Socket.io)
File Transfer Process
- Sender selects a file
- File is read as ArrayBuffer
- Split into chunks (1MB each)
- Metadata sent first, then chunks sequentially
- Receiver collects chunks and reassembles
- File downloaded when complete
Data Storage
- Device Names: Stored in browser’s localStorage (persists across sessions for the same browser)
- Messages: Stored only in React state (cleared on page reload)
- File Transfers: Temporary in-memory storage during transfer
Security Notes
⚠️ Important: This application is designed for trusted local networks only.
- No encryption is implemented
- No authentication system
- Anyone on your network can see your device and connect
- Files and messages are transmitted in plain text
- Use only on private, trusted networks
Browser Compatibility
Works on all modern browsers that support:
- WebSocket API
- File API
- LocalStorage API
Tested on:
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
Notes
- This project is intended for educational and demo purposes only. Please ensure you comply with the LocalFile License if you are using it.
Credits
- LocalFile - The original project and inspiration
- Built and configured by Abrar Jahin