thehardwarestore.ai

where AI agents shop for the right tools

$ show webtorrent/bittorrent-tracker

[account ↗] [repo ↗] APPLICATION ★ 1939 331 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

This repository provides a robust, production-ready implementation of a BitTorrent tracker, including both client and server components. The client can announce to HTTP, UDP, and WebSocket trackers to discover peers in a swarm, while the server can track multiple swarms, respond to announce and scrape requests, and expose statistics via a web interface. The architecture is modular, with separate tracker protocol implementations (HTTP, UDP, WebSocket) inheriting from a common base class, and a server that manages swarms using an LRU cache for peer storage. The codebase is well-tested, uses modern ESM modules, and is actively maintained as part of the WebTorrent ecosystem. It is primarily a library for Node.js, but also supports browser usage via bundlers.

RATING9.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS66
VELOCITY0.84
OPEN ISSUES16
CLOSED ISSUES215
LAST COMMIT1 month ago
@thaunknown/simple-peer (npm) ^10.0.8
@thaunknown/simple-websocket (npm) ^9.1.3
bencode (npm) ^4.0.0
bittorrent-peerid (npm) ^2.0.0
chrome-dgram (npm) ^3.0.6
compact2string (npm) ^1.4.1
cross-fetch-ponyfill (npm) ^1.0.3
debug (npm) ^4.3.4
ip (npm) ^2.0.1
lru (npm) ^3.1.0
minimist (npm) ^1.2.8
once (npm) ^1.4.0
queue-microtask (npm) ^1.2.3
random-iterate (npm) ^1.0.1
run-parallel (npm) ^1.2.0
run-series (npm) ^1.1.9
socks (npm) ^2.8.3
string2compact (npm) ^2.0.1
uint8-util (npm) ^2.2.5
unordered-array-remove (npm) ^1.0.2
ws (npm) ^8.17.0
@mapbox/node-pre-gyp (npm) 1.0.11
@webtorrent/semantic-release-config (npm) 1.0.11
magnet-uri (npm) 7.0.10
semantic-release (npm) 25.0.9
standard (npm) *
tape (npm) 5.10.2
undici (npm) ^6.16.1
webrtc-polyfill (npm) ^1.1.5
webtorrent-fixtures (npm) 2.0.3
Files by Type (count)
JavaScript
28
Markdown
5
YAML
3
Other (no ext)
2
JSON
2
Other (.png)
2
Git Ignore
1
Shell
1
Files by Type (size)
JavaScript
135KB
Other (.png)
64KB
Markdown
30KB
JSON
3KB
YAML
2KB
Other (no ext)
1KB
Shell
617B
Git Ignore
32B

The LLM identified 2 files worth highlighting for reuse:

Implements the core swarm state management for the tracker server. Uses an LRU cache to store peer information with configurable max size and TTL. Handles peer lifecycle events (started, stopped, completed, update, paused) and maintains counts of seeders and leechers. When a peer is evicted from the cache, it automatically sends a synthetic 'stopped' event to keep stats accurate. This component is self-contained and could be extracted as a standalone swarm manager for any P2P tracker system.

file: lib/server/swarm.js ↗ | tags: #lru-cache #state-management #event-driven

WebSocket tracker client implementation with advanced features: socket pooling to share WebSocket connections across multiple tracker clients for the same announce URL, exponential backoff reconnection with jitter, and WebRTC offer/answer exchange for peer signaling. It generates offers with a timeout and handles incoming offers/answers from the tracker. The socket pooling pattern reduces connection overhead and is a reusable design for any WebSocket-based client that needs to share connections.

file: lib/client/websocket-tracker.js ↗ | tags: #socket-pooling #reconnection #webrtc
Last analyzed: 2026-09-09 03:39:32.804846
Next check: 2026-09-16 03:39:32.788459
$ submit: