π Decentralized website hosting powered by WebTorrent π
PeerWeb enables truly decentralized, censorship-resistant website hosting through peer-to-peer networks. Upload your static websites and share them globally without relying on centralized servers or paying hosting fees.
-
Main Page - https://peerweb.lol
-
Functionality Demo with local resources - https://peerweb.lol/?orc=90c020bd252639622a14895a0fad713b91e0130c
-
SomaFM on PeerWeb - https://peerweb.lol/?orc=908d19242ae1461f333a516d1f8b89c13ef2d259
-
Chess on PeerWeb - https://peerweb.lol/?orc=525bad84c4637cc49b47e3b9a5e3e9bd6a6dc398
-
Text Editor app on PeerWeb - https://peerweb.lol/?orc=4e5f1204dcec68195bfcc89f9410a0b70a0ddfac
-
Markdown Editor on PeerWeb - https://peerweb.lol/?orc=59587ae54c2cc2cf1b0419728ab5625fd7c54fdf
- Drag & Drop Upload - Simply drag your website folder
- Instant Sharing - Get a shareable PeerWeb link immediately
- Zero Hosting Costs - No servers, no monthly fees, completely free
- Censorship Resistant - Distributed across peer-to-peer networks
- Always Available - Works as long as there are online peers
- Intelligent Caching - Lightning-fast loading with IndexedDB storage
- Service Worker Magic - Seamless resource loading and offline support
- Progress Tracking - Real-time download progress and peer statistics
- Auto Cleanup - Expired cache automatically cleaned after 7 days
- XSS Protection - All HTML sanitized with DOMPurify
- Hash Sanitization - Torrent hashes sanitized to prevent XSS attacks
- Sandboxed Execution - Sites run in isolated iframe environments
- Content Validation - All resources validated before display
- External Link Preservation - Social media and external links work normally
- Memory Leak Prevention - Automatic cleanup of timeouts and object URLs
- Toast Notifications - Non-blocking, user-friendly notifications
- Quick Upload Interface - Prominent drag-and-drop area
- Advanced Torrent Creator - Full-featured torrent creation tools
- Debug Mode - Detailed logging for developers and troubleshooting
- PWA Support - Install as a Progressive Web App on any device
- Mobile Friendly - Responsive design works on all devices
- Open PeerWeb.lol in your browser
- Drag your website folder to the upload area
- Get your unique PeerWeb URL, and keep the tab open
- Share the link with anyone, anywhere!
- Enter a torrent hash in the load field
- Or use a PeerWeb URL:
https://peerweb.lol?orc=HASH - Website loads directly from the peer network
Add &debug=true to any PeerWeb URL for detailed logging:
https://peerweb.lol?orc=ABC123...&debug=true
Your websites should be:
- β Static content only (HTML, CSS, JS, images, fonts, etc.)
- β Include index.html (in root)
- β Use relative paths for all internal resources
- β Responsive design recommended for best experience
peerweb/
βββ index.html # Main application interface
βββ peerweb.js # Core PeerWeb functionality
βββ peerweb.min.js # Minified version
βββ peerweb-sw.js # Service Worker for resource handling
βββ manifest.json # PWA manifest for installable web app
βββ README.md # This file
-
Upload Process
- Your website files are packaged into a BitTorrent torrent
- A unique hash identifies your site across the network
- Files are seeded from your browser to the peer network
-
Loading Process
- Service Worker intercepts resource requests
- Files are downloaded via WebTorrent from multiple peers
- Content is cached locally for instant future access
-
Security Layer
- All HTML content sanitized with DOMPurify
- Torrent hashes sanitized to prevent XSS
- Sites run in sandboxed iframe
- External links preserved and functional
- Automatic memory cleanup on page unload
Enable detailed logging by adding &debug=true to any URL:
// Example debug output
[PeerWeb:DEBUG] Loading site with hash: abc123...
[PeerWeb:INFO] Found 15 files in torrent
[PeerWeb:DEBUG] Processing site early (95% complete)
[PeerWeb SW] Serving file: styles.css (2.4KB)PeerWeb automatically detects the environment:
- Production (peerweb.lol): Only shows warnings and errors
- Development (localhost): Shows all debug information
Install PeerWeb on any device:
- Visit PeerWeb.lol
- Look for "Install" or "Add to Home Screen" in your browser
- Use PeerWeb like a native application
Features when installed:
- Standalone app window
- App icon on home screen/desktop
- Faster loading with caching
- Offline access to cached sites
We welcome contributions! Here's how you can help:
- Use the Issues tab
- Include browser version, steps to reproduce, and error messages
- Enable debug mode for detailed logs
- Open a Feature Request
- Describe the use case and expected behavior
- Check existing issues to avoid duplicates
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Submit a Pull Request with detailed description
- Fix typos or unclear instructions
- Add examples and use cases
- Translate to other languages
- β Chrome/Chromium 60+ (Recommended)
- β Firefox 55+
- β Safari 11+
- β Edge 79+
- β Internet Explorer (Not supported)
- Uses WebTorrent for browser-based torrenting
- Compatible with standard BitTorrent protocol
- Supports DHT, PEX, and WebRTC connections
- Static sites only - No server-side processing
- Browser hosting - Sites available while browser tab is open
- Peer dependency - Requires active peers for availability
- Large files - May be slow for sites with many large assets
Multi-layer XSS protection:
- HTML Sanitization - All HTML content sanitized with DOMPurify
- Hash Sanitization - Torrent hashes stripped of non-hex characters
- Script Injection Prevention - Malicious scripts blocked
- Dangerous Elements - Unsafe HTML elements and attributes removed
Websites run in sandboxed iframes with restrictions:
<iframe sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-modals"></iframe>- External links (social media, email, etc.) work normally
- CDN resources and external stylesheets load properly
- Only internal site resources are processed through PeerWeb
- Portfolio sites
- Blogs and documentation
- Landing pages
- Resume/CV sites
- Art galleries
- Photography portfolios
- Interactive demos
- Games and experiments
- Course materials
- Tutorials and guides
- Research publications
- Student projects
- News and journalism
- Political content
- Whistleblowing platforms
- Freedom of speech tools
For permanent hosting without keeping browser tabs open:
- πͺ Windows - PeerWeb Desktop (Coming Soon)
- π macOS - PeerWeb Desktop (Coming Soon)
- π§ Linux - PeerWeb Desktop (Coming Soon)
- Documents: HTML, CSS, JavaScript, JSON, XML
- Images: PNG, JPEG, GIF, SVG, WebP, ICO
- Fonts: WOFF, WOFF2, TTF, OTF, EOT
- Media: MP4, WebM, MP3, WAV
- Other: PDF and various binary formats
- Caching: IndexedDB with 7-day expiration
- Loading: Progressive loading with 95% threshold
- Piece Size: Optimized based on total site size
- Timeout: 5-second request timeout with fallbacks
- Memory Management: Automatic cleanup of timeouts and object URLs
- Resource Tracking: All setTimeout calls tracked and cleaned up
- Trackers: 7+ built-in BitTorrent trackers
- Protocols: WebRTC, WebSocket, HTTP fallback
- DHT: Distributed Hash Table support
- PEX: Peer Exchange for discovery
This project is licensed under the MIT License - see the LICENSE file for details.
- WebTorrent - Browser-based BitTorrent implementation
- DOMPurify - XSS sanitizer for HTML
- BitTorrent Protocol - Peer-to-peer file sharing foundation
- Service Workers - Enabling offline-first web applications
- π Documentation: Check this README and inline code comments
- π Bug Reports: Use GitHub Issues with debug logs
- π¬ Community: Join discussions in GitHub Discussions
- π§ Contact: Create an issue for direct support
Q: How long do sites stay available? A: Sites remain available as long as at least one peer is seeding them.
Q: Can I update my website? A: Create a new torrent for updates. The hash will change with new content.
Q: Is there a file size limit? A: No hard limits, but larger sites may load slower due to peer availability.
Q: Can I use custom domains?
A: Yes! Deploy PeerWeb to your domain and use ?orc=HASH parameters.
Q: Does it work offline? A: Cached sites work offline. New sites require internet for initial download.
π Star this project if you find it useful! π
Made with β€οΈ for the decentralized web