- return &ClientConfig{
- HTTP: &http.Client{
- Timeout: time.Second * 15,
- Transport: &http.Transport{
- Dial: (&net.Dialer{
- Timeout: 15 * time.Second,
- }).Dial,
- TLSHandshakeTimeout: 15 * time.Second,
- TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
- }},
- HTTPUserAgent: DefaultHTTPUserAgent,
- ExtendedHandshakeClientVersion: "go.torrent dev 20150624",
- Bep20: "-GT0001-",
- NominalDialTimeout: 30 * time.Second,
- MinDialTimeout: 5 * time.Second,
- EstablishedConnsPerTorrent: 50,
- HalfOpenConnsPerTorrent: 25,
- TorrentPeersHighWater: 500,
- TorrentPeersLowWater: 50,
- HandshakesTimeout: 20 * time.Second,
- DhtStartingNodes: dht.GlobalBootstrapAddrs,
- ListenHost: func(string) string { return "" },
- UploadRateLimiter: unlimited,
- DownloadRateLimiter: unlimited,
+ cc := &ClientConfig{
+ HTTPUserAgent: version.DefaultHttpUserAgent,
+ ExtendedHandshakeClientVersion: version.DefaultExtendedHandshakeClientVersion,
+ Bep20: version.DefaultBep20Prefix,
+ UpnpID: version.DefaultUpnpId,
+ NominalDialTimeout: 20 * time.Second,
+ MinDialTimeout: 3 * time.Second,
+ EstablishedConnsPerTorrent: 50,
+ HalfOpenConnsPerTorrent: 25,
+ TotalHalfOpenConns: 100,
+ TorrentPeersHighWater: 500,
+ TorrentPeersLowWater: 50,
+ HandshakesTimeout: 4 * time.Second,
+ KeepAliveTimeout: time.Minute,
+ MaxAllocPeerRequestDataPerConn: 1 << 20,
+ ListenHost: func(string) string { return "" },
+ UploadRateLimiter: unlimited,
+ DownloadRateLimiter: unlimited,
+ DisableAcceptRateLimiting: true,
+ DropMutuallyCompletePeers: true,
+ HeaderObfuscationPolicy: HeaderObfuscationPolicy{
+ Preferred: true,
+ RequirePreferred: false,
+ },
+ CryptoSelector: mse.DefaultCryptoSelector,
+ CryptoProvides: mse.AllSupportedCrypto,
+ ListenPort: 42069,
+ Extensions: defaultPeerExtensionBytes(),
+ AcceptPeerConnections: true,
+ MaxUnverifiedBytes: 64 << 20,