gaffner / PyBitTorrent

MIT License
4 stars 2 forks source link

Add support for compact mode in tracker response #2

Closed gaffner closed 1 year ago

gaffner commented 1 year ago

compact: Setting this to 1 indicates that the client accepts a compact response. The peers list is replaced by a peers string with 6 bytes per peer. The first four bytes are the host (in network byte order), the last two bytes are the port (again in network byte order). It should be noted that some trackers only support compact responses (for saving bandwidth) and either refuse requests without "compact=1" or simply send a compact response unless the request contains "compact=0" (in which case they will refuse the request.)