func main() {
flags := struct {
+ Port uint16
tagflag.StartPos
Torrents []string `arity:"+"`
- }{}
+ }{
+ Port: 50007,
+ }
tagflag.Parse(&flags)
ar := tracker.AnnounceRequest{
NumWant: -1,
Left: math.MaxUint64,
+ Port: flags.Port,
}
var wg sync.WaitGroup
for _, arg := range flags.Torrents {
q.Set("info_hash", string(ar.InfoHash[:]))
q.Set("peer_id", string(ar.PeerId[:]))
+ // AFAICT, port is mandatory, and there's no implied port key.
q.Set("port", fmt.Sprintf("%d", ar.Port))
q.Set("uploaded", strconv.FormatInt(ar.Uploaded, 10))
q.Set("downloaded", strconv.FormatInt(ar.Downloaded, 10))