github.com/0chain/gosdk@v1.17.11/core/resty/transport.go (about) 1 //go:build !js && !wasm 2 // +build !js,!wasm 3 4 package resty 5 6 import ( 7 "net" 8 "net/http" 9 "time" 10 ) 11 12 var DefaultHeader = make(map[string]string) 13 14 // Run the HTTP request in a goroutine and pass the response to f. 15 var DefaultTransport = &http.Transport{ 16 Proxy: http.ProxyFromEnvironment, 17 MaxIdleConns: 1000, 18 IdleConnTimeout: 90 * time.Second, 19 TLSHandshakeTimeout: 10 * time.Second, 20 ExpectContinueTimeout: 1 * time.Second, 21 MaxIdleConnsPerHost: 5, 22 ForceAttemptHTTP2: true, 23 24 DialContext: (&net.Dialer{ 25 Timeout: 30 * time.Second, 26 KeepAlive: 30 * time.Second, 27 DualStack: true, 28 }).DialContext, 29 }