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