Drag & drop files here
or click to select files
Recent Uploads
No recent uploads
Server Stats
π Gateway API
βͺTotal Files: 0
Storage Used: 0 MB
Downloads Served: 0
πΈ Blossom Server
βͺBlobs Stored: 0
Blob Storage: 0 MB
Requests Today: 0
πΈοΈ DHT Node
βͺNetwork Peers: 0
Torrents Seeding: 0
Announces Today: 0
π‘ BitTorrent Tracker
βͺActive Torrents: 0
Connected Peers: 0
Seeders/Leechers: 0/0
System Information
My Files Dashboard
No files uploaded yet.
β‘ BitTorrent Gateway
Decentralized Content Distribution with Nostr Integration
What This Platform Does
The BitTorrent Gateway is a next-generation content distribution system that combines the reliability of traditional web hosting with the power of peer-to-peer networks and decentralized social discovery through Nostr. It automatically chooses the best way to store and distribute your files:
Stored as blobs for instant access and immediate availability
Automatically chunked into 2MB pieces with torrent + DHT distribution
Why This Approach Works
π How Nostr Integration Works
Nostr (Notes and Other Stuff Transmitted by Relays) is a decentralized protocol that enables censorship-resistant social networking. Here's how we integrate it for content distribution:
Content Upload
You upload a file using your Nostr identity (no email or passwords needed)
Automatic Processing
System creates torrents, generates magnet links, and sets up WebSeed URLs
Nostr Announcement
File metadata is broadcast to Nostr relays as a structured event
Social Discovery
Other users can discover, comment on, and share your content through Nostr clients
Benefits of Nostr Integration:
- No Central Control: Content discovery happens through the distributed Nostr relay network
- Social Features: Users can comment, react, and share content using any Nostr client
- Network Effects: Content spreads naturally through social connections
- Privacy: You control your identity and data through cryptographic keys
- Interoperability: Works with existing Nostr apps and clients
Example Nostr Event:
{ "kind": 2003, "content": "New torrent: example-video.mp4", "tags": [ ["title", "Example Video"], ["x", "d1c5a0f85a4e4f3d8e7d8f9c6b5a4e3f2d1c0b9a8e7d6f5c4b3a2e1d0c9b8a7f6"], ["file", "example-video.mp4", "157286400"], ["magnet", "magnet:?xt=urn:btih:..."], ["webseed", "https://gateway.example.com/api/webseed/..."], ["blossom", "sha256_blob_hash"], ["stream", "https://gateway.example.com/api/stream/hash"], ["hls", "https://gateway.example.com/api/stream/hash/playlist.m3u8"], ["duration", "3600"], ["video", "1920x1080", "30fps", "h264"], ["m", "video/mp4"], ["t", "torrent"], ["t", "video"], ["t", "streaming"], ["tcat", "video,streaming"] ] }
This event gets distributed across Nostr relays, allowing anyone subscribed to file announcements to discover new content.
How It Works
π‘ P2P Coordination
The system features a sophisticated P2P coordinator that manages all networking components, providing unified peer discovery, smart peer ranking, load balancing, and health monitoring across tracker, DHT, and WebSeed sources.
π― Built-in BitTorrent Tracker
Includes a full BitTorrent tracker with advanced features:
- Client Compatibility: Optimized for qBittorrent, Transmission, WebTorrent, Deluge, uTorrent
- Abuse Prevention: Advanced detection and rate limiting systems
- Geographic Optimization: Proximity-based peer selection for faster transfers
π WebSeed Implementation (BEP-19)
Advanced WebSeed features for guaranteed availability:
- LRU Caching: Intelligent piece caching with configurable size limits
- Concurrent Optimization: Prevents duplicate loads, manages request limits
- Standards Compliant: Full BEP-19 specification support
π File Processing Pipeline
File received, SHA-256 hash calculated, size analysis determines storage strategy
Small files stored as blobs, large files chunked and torrents created
Content announced to DHT network and Nostr relays for discovery
Content immediately available via WebSeed, P2P peers join over time
Key Features
Intelligent Content Distribution
Automatic selection between blob storage and BitTorrent based on file size, with WebSeed fallback ensuring 100% availability
Multi-Protocol Support
Full BitTorrent protocol, WebSeed (BEP-19), DHT, and Nostr integration for comprehensive P2P networking
Production-Ready Security
Multi-layer rate limiting, advanced abuse detection, input sanitization, and comprehensive security headers
Comprehensive Monitoring
Real-time P2P health monitoring with 0-100 scoring system, performance metrics, and automatic alerting
BitTorrent Client Compatibility
Optimized for popular clients with client-specific adjustments and proper announce intervals
Smart Caching & Optimization
LRU caching system, concurrent processing, geographic peer selection, and connection pooling
System Architecture
π Gateway Server (Port 9877)
Main API server with WebSeed implementation, smart proxy for chunked content reassembly, advanced LRU caching system, and comprehensive security middleware.
πΈ Blossom Server (Port 8082)
Content-addressed blob storage with Nostr protocol compatibility, SHA-256 addressing, and direct storage for files under 100MB.
πΈοΈ DHT Node (Port 6883)
Full Kademlia DHT implementation with bootstrap connectivity to major networks, automatic torrent announcement, and peer discovery.
π‘ Built-in BitTorrent Tracker
Full announce/scrape protocol support, client compatibility optimizations, abuse detection, and peer management with geographic proximity selection.
π― P2P Coordinator
Unified management of all P2P components, smart peer ranking algorithm, load balancing across sources, and comprehensive health monitoring.
API Reference
Core API Endpoints
/api/upload
Upload files with intelligent storage routing
/api/download/{hash}
Download files by hash (range requests supported)
/api/torrent/{hash}
Get .torrent file for BitTorrent clients
/api/stats
Overall system statistics
/api/p2p/stats
Detailed P2P statistics
/api/health
Component health status
WebSeed & P2P Endpoints
/api/webseed/{hash}
WebSeed endpoint for BitTorrent clients (BEP-19)
/api/webseed/health
WebSeed health check and cache statistics
/api/diagnostics
Comprehensive system diagnostics
WebSeed Features:
- β BEP-19 compliant WebSeed implementation
- β Advanced LRU piece caching
- β Concurrent request optimization
- β Client-specific optimizations
- β Range request support
Blossom Protocol Endpoints
/upload
Upload blob to Blossom server
/{hash}
Download blob by SHA-256 hash
/info
Server information and capabilities
BitTorrent Tracker Endpoints
/announce
BitTorrent announce endpoint for peer discovery
/scrape
BitTorrent scrape endpoint for torrent statistics
Tracker Features:
- β Built-in tracker eliminates external dependencies
- β Always includes gateway as WebSeed peer
- β Supports both compact and dictionary peer formats
- β Automatic peer cleanup after 45 minutes
- β Full BitTorrent protocol compliance
Technical Implementation
Intelligent Storage Strategy
Files under 100MB stored as blobs for immediate access. Larger files automatically chunked into 2MB pieces with BitTorrent-compatible structure for parallel transfers.
Advanced P2P Coordination
Sophisticated peer ranking algorithm considering geographic proximity (30%), source reliability (25%), and historical performance (20%) for optimal peer selection.
Production-Grade Performance
LRU piece caching, concurrent request handling, connection pooling, and comprehensive health monitoring with automatic alerting systems.
Multi-Client Optimization
Built-in tracker with client detection and specific optimizations for qBittorrent, Transmission, WebTorrent, and other popular BitTorrent clients.