bittorrent-tracker
File Transfer - Peer-to-peer Filesharing
About this project
Simple, robust, BitTorrent tracker (client & server) implementation
Node.js implementation of a BitTorrent tracker, client and server.
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.
This module is used by WebTorrent.
features
- Includes client & server implementations
- Supports all mainstream tracker types:
- HTTP trackers
- UDP trackers (BEP 15)
- WebTorrent trackers (BEP forthcoming)
- Supports ipv4 & ipv6
- Supports tracker "scrape" extension
- Robust and well-tested
- Comprehensive test suite (runs entirely offline, so it's reliable)
- Used by popular clients: WebTorrent, peerflix, and playback
- Tracker statistics available via web interface at
/stats
or JSON data at/stats.json
Also see bittorrent-dht.
Tracker stats
install
npm install bittorrent-tracker
usage
client
To connect to a tracker, just do this:
import Client from 'bittorrent-tracker'
const requiredOpts = {
infoHash: new Buffer('012345678901234567890'), // hex string or Buffer
peerId: new Buffer('01234567890123456789'), // hex string or Buffer
announce: [], // list of tracker server urls
port: 6881 // torrent client port, (in browser, optional)
}
const optionalOpts = {
// RTCPeerConnection config object (only used in browser)
rtcConfig: {},
// User-Agent header for http requests
userAgent: '',
// Custom webrtc impl, useful in node to specify [wrtc](https://npmjs.com/package/wrtc)
wrtc: {},
getAnnounceOpts: function () {
// Provide a callback that will be called whenever announce() is called
// internally (on timer), or by the user
Technologies & License
MIT
Node.js
Quick Deploy
Deploy this project to cloud platforms with one click