A BitTorrent tracker is a web service which responds to requests from BitTorrent
clients. The requests include metrics from clients that help the tracker keep overall
statistics about the torrent. The response includes a peer list that helps the client
participate in the torrent swarm.
Comprehensive test suite (runs entirely offline, so it's reliable)
Tracker statistics available via web interface at /stats or JSON data at /stats.json
Requires NodeJS 6+
Install
npm install uwt
Usage
To start a WebTorrent tracker server to track swarms of peers:
const Server = require('uwt')const server = new Server({ stats: true, // enable web-based statistics? [default=true] filter: function (infoHash, params, cb) { // Blacklist/whitelist function for allowing/disallowing torrents. If this option is // omitted, all torrents are allowed. It is possible to interface with a database or // external system before deciding to allow/deny, because this function is async. // It is possible to block by peer id (whitelisting torrent clients) or by secret // key (private trackers). Full access to the original HTTP/UDP request parameters // are available in `params`. // This example only allows one torrent. const allowed = (infoHash === 'aaa67059ed6bd08362da625b3ae77f6f4a075aaa') if (allowed) { cb(null) }