// impact of a few bad apples. 4s loses 1% of successful handshakes that
// are obtained with 60s timeout, and 5% of unsuccessful handshakes.
HandshakesTimeout time.Duration // default 20 * time.Second
+
+ PublicIp4 net.IP
+ PublicIp6 net.IP
}
func (cfg *Config) setDefaults() {
UserAgent string
HttpClient *http.Client
UdpNetwork string
- ClientIp4 krpc.NodeAddr
- ClientIp6 krpc.NodeAddr
+ // If the port is zero, it's assumed to be the same as the Request.Port
+ ClientIp4 krpc.NodeAddr
+ // If the port is zero, it's assumed to be the same as the Request.Port
+ ClientIp6 krpc.NodeAddr
}
// In an FP language with currying, what order what you put these params?
"net/url"
"time"
+ "github.com/anacrolix/dht/krpc"
"github.com/anacrolix/missinggo"
"github.com/anacrolix/torrent/tracker"
TrackerUrl: me.trackerUrl(ip),
Request: req,
HostHeader: me.u.Host,
+ UdpNetwork: me.u.Scheme,
+ ClientIp4: krpc.NodeAddr{IP: me.t.cl.config.PublicIp4},
+ ClientIp6: krpc.NodeAddr{IP: me.t.cl.config.PublicIp6},
}.Do()
if err != nil {
ret.Err = fmt.Errorf("error announcing: %s", err)