[manual index][section index]

NAME

torrent/track - tracker for torrents

SYNOPSIS

torrent/track [ -d ] [ -h hashesfile ] [ -i interval ] [ -m maxpeers ] [ -s statefile statefile flushtime ] scgiaddr

DESCRIPTION

Torrent/track is a tracker for torrents. It allows peers to find each other. It is meant to be used with a httpd, e.g. shttpd(1). Torrent/track listens on scgiaddr for scgi requests. It can either serve any torrent file, or only those explicitly specified in a file. It can store its state, which includes all peers with info hashes, to file and read them during start up, for fast restarting. Peers not seen before are checked for reachability. If they are not reachable (accepting connections), they are not returned in tracker responses. After one hour, the peer can be checked for reachability again.

Compact requests (BEP 23) are supported, but not the default in absence of the compact request parameter. Tracker/torrent returns the external ip address of the requesting peer (BEP 24). IPv6 peers (BEP 7) are supported too.

-d
Print debug information
-h hashesfile
Read a list of info hashes to serve. Without this file, any info hash is served. Hashesfile must have one info hash per line, in hexadecimal.
-i interval
Set the interval to send to peers. Peers normally wait interval seconds before sending another request to the tracker. Default is 1200 seconds.
-m maxpeers
Set maximum number of peers to return in single request. The default is 30.
-s statefile statefile flushtime
At startup, attempt to read the state of the tracker from the statefile's. During operation, write the state to the files after changes (but wait flushtime seconds to accumulate changes and prevent too frequent writes). For reading, the most recent file is looked at first. If parsing it fails, the other is read. For writing the state, the oldest file is truncated and rewritten.

EXAMPLE

torrent/track net!localhost!4000
httpd -a net!*!80 -s /announce net!localhost!4020 GET /lib/empty

SOURCE

/appl/cmd/torrent/track.b
/module/bittorrent.m
/appl/lib/bittorrent.b

SEE ALSO

torrentcreate(1), torrentpeer(4), shttpd(8),
``BEP 23 - Tracker Returns Compact Peer Lists'',
``BEP 24 - Tracker Returns External IP''.
``BEP 7 - IPv6 Tracker Extension''.

BUGS

Does not (yet) try to be smart about the list of peers to send. Torrent/track can return seeders to seeders, and peers to themselves.
The peer is not verified to listen on the claimed port.
The request parameters ``ip'', and ``ipv4'' and ``ipv6'' (from BEP 7) are ignored, and only the ip address from the request is used.

TORRENTTRACK(1 ) Rev:  Wed Feb 22 04:14:06 GMT 2023