Owez / torro

A correct and easy-to-use BitTorrent library
MIT License
9 stars 0 forks source link

UDP Tracker vs GET Tracker #22

Closed Owez closed 3 years ago

Owez commented 3 years ago

BEP0003 describes the common tracker request as a standard HTTP GET request:

Tracker GET requests have the following keys:

info_hash

    The 20 byte sha1 hash of the bencoded form of the info value from the metainfo file. This value will almost certainly have to be escaped.

    Note that this is a substring of the metainfo fil...

But it also links to the BEP0015 specification for UDP trackers that may also be used. It seems like this is the reasoning behind UDP:

To discover other peers in a swarm a client announces it's existance to a tracker. The HTTP protocol is used and a typical request contains the following parameters: info_hash, key, peer_id, port, downloaded, left, uploaded and compact. A response contains a list of peers (host and port) and some other information. The request and response are both quite short. Since TCP is used, a connection has to be opened and closed, introducing additional overhead

torro aims to have no dependencies but a HTTP library may ruin this, by using the "better" BEP0015 standard which introduces more features, it can kill two birds with one stone

Owez commented 3 years ago

Started on UDP tracker, will do any future commits in a pr