Home > Specs > BitTorrent
Web Seeds
Web seeds are peers that are actually conventional web servers that host one or more files in the torrent. It is possible to treat them just like any other peer and download blocks or whole pieces by using the HTTP chunking methods, thereby integrating their operation well with other peers.
Web seed URLs can only be distributed via
.torrent files or special attributes appended to a
magnet link. They are not stored within the regular torrent info map.
Web seed URLs can begin with
http:
or
https:
, in which case the outgoing connection must be wrapped in a TLS client socket.
Inside the outermost map in a
.torrent file, web seed URLs are stored in the
url-list
key as either a single string or a list of strings.
In a
magnet link, one or more web seed URLs are each stored, with an inner layer of URL encoding, in a
ws
attribute.
Web seed URLs that don't end in a slash '/' are to be used without modification when making requests from the HTTP server. They are only valid for single-file torrents.
URLs that do end in a slash '/' must have the torrent name appended, and then the path within the torrent of the individual file that contains the requested piece bytes.
In multi-file torrents, the requested byte range will have to be calculated very carefully. The file's position in the torrent will have to be subtracted from the piece's position in the torrent to find the proper offset within the file being requested.
GET /somepath/torrentname/path/to/file.mp4 HTTP/1.1
Host: web.archive.example
User-Agent: ClientName/1.0
Connection: keep-alive
Range: bytes=49152-65535
Note that in HTTP ranges, the end number denotes the index of the last byte index included in the range, NOT the first byte after the end.