+// Contains config elements that are exclusive to tracker handling. There may be other fields in
+// ClientConfig that are also relevant.
+type ClientTrackerConfig struct {
+ // Don't announce to trackers. This only leaves DHT to discover peers.
+ DisableTrackers bool `long:"disable-trackers"`
+ // Defines DialContext func to use for HTTP tracker announcements
+ TrackerDialContext func(ctx context.Context, network, addr string) (net.Conn, error)
+ // Defines ListenPacket func to use for UDP tracker announcements
+ TrackerListenPacket func(network, addr string) (net.PacketConn, error)
+ // Takes a tracker's hostname and requests DNS A and AAAA records.
+ // Used in case DNS lookups require a special setup (i.e., dns-over-https)
+ LookupTrackerIp func(*url.URL) ([]net.IP, error)
+}
+
+type ClientDhtConfig struct {
+ // Don't create a DHT.
+ NoDHT bool `long:"disable-dht"`
+ DhtStartingNodes func(network string) dht.StartingNodesGetter
+ // Called for each anacrolix/dht Server created for the Client.
+ ConfigureAnacrolixDhtServer func(*dht.ServerConfig)
+ PeriodicallyAnnounceTorrentsToDht bool
+ // OnQuery hook func
+ DHTOnQuery func(query *krpc.Msg, source net.Addr) (propagate bool)
+}
+