}
return cl.config.PublicIp4
}(),
- StartingNodes: cl.config.DhtStartingNodes,
+ StartingNodes: cl.config.DhtStartingNodes(conn.LocalAddr().Network()),
ConnectionTracking: cl.config.ConnTracker,
OnQuery: cl.config.DHTOnQuery,
Logger: cl.logger.WithValues("dht", conn.LocalAddr().String()),
cfg := TestingConfig()
cfg.ListenHost = func(string) string { return "" }
cfg.NoDHT = false
- cfg.DhtStartingNodes = func() ([]dht.Addr, error) { return nil, nil }
- // For now, we want to just jam the nodes into the table, without
- // verifying them first. Also the DHT code doesn't support mixing secure
- // and insecure nodes if security is enabled (yet).
+ cfg.DhtStartingNodes = func(string) dht.StartingNodesGetter { return func() ([]dht.Addr, error) { return nil, nil } }
+ // For now, we want to just jam the nodes into the table, without verifying them first. Also the
+ // DHT code doesn't support mixing secure and insecure nodes if security is enabled (yet).
// cfg.DHTConfig.NoSecurity = true
cl, err := NewClient(cfg)
require.NoError(t, err)
// Don't create a DHT.
NoDHT bool `long:"disable-dht"`
- DhtStartingNodes dht.StartingNodesGetter
+ DhtStartingNodes func(network string) dht.StartingNodesGetter
// Never send chunks to peers.
NoUpload bool `long:"no-upload"`
// Disable uploading even when it isn't fair.
TorrentPeersHighWater: 500,
TorrentPeersLowWater: 50,
HandshakesTimeout: 4 * time.Second,
- DhtStartingNodes: dht.GlobalBootstrapAddrs,
- ListenHost: func(string) string { return "" },
- UploadRateLimiter: unlimited,
- DownloadRateLimiter: unlimited,
- ConnTracker: conntrack.NewInstance(),
- DisableAcceptRateLimiting: true,
+ DhtStartingNodes: func(network string) dht.StartingNodesGetter {
+ return func() ([]dht.Addr, error) { return dht.GlobalBootstrapAddrs(network) }
+ },
+ ListenHost: func(string) string { return "" },
+ UploadRateLimiter: unlimited,
+ DownloadRateLimiter: unlimited,
+ ConnTracker: conntrack.NewInstance(),
+ DisableAcceptRateLimiting: true,
HeaderObfuscationPolicy: HeaderObfuscationPolicy{
Preferred: true,
RequirePreferred: false,
require (
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669
github.com/alexflint/go-arg v1.2.0
- github.com/anacrolix/dht/v2 v2.5.0
+ github.com/anacrolix/dht/v2 v2.5.1-0.20200317023935-129f05e9b752
github.com/anacrolix/envpprof v1.1.0
github.com/anacrolix/go-libutp v1.0.2
github.com/anacrolix/log v0.6.0
github.com/anacrolix/dht/v2 v2.3.2-0.20200103043204-8dce00767ebd/go.mod h1:cgjKyErDnKS6Mej5D1fEqBKg3KwFF2kpFZJp3L6/fGI=
github.com/anacrolix/dht/v2 v2.5.0 h1:AYoGu41z2fellHU9zdFZOQFr8E3epyAGWk6RfOz5UVE=
github.com/anacrolix/dht/v2 v2.5.0/go.mod h1:7RLvyOjm+ZPA7vgFRP+1eRjFzrh27p/nF0VCk5LcjoU=
+github.com/anacrolix/dht/v2 v2.5.1-0.20200317023935-129f05e9b752 h1:Cg9KyjeymlTOYY+SQ2FeIij9eaZI/eUFprAXYWL0AA8=
+github.com/anacrolix/dht/v2 v2.5.1-0.20200317023935-129f05e9b752/go.mod h1:7RLvyOjm+ZPA7vgFRP+1eRjFzrh27p/nF0VCk5LcjoU=
github.com/anacrolix/envpprof v0.0.0-20180404065416-323002cec2fa h1:xCaATLKmn39QqLs3tUZYr6eKvezJV+FYvVOLTklxK6U=
github.com/anacrolix/envpprof v0.0.0-20180404065416-323002cec2fa/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c=
github.com/anacrolix/envpprof v1.0.0 h1:AwZ+mBP4rQ5f7JSsrsN3h7M2xDW/xSE66IPVOqlnuUc=