Closed cinience closed 2 years ago
` 问题代码在: github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go 的方法: func (client *Client) setTimeout(request requests.AcsRequest)
`
调用代码如下:
var SpecifiDnsServerTransport http.Transport = &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 30 time.Second, KeepAlive: 30 time.Second, Resolver: &net.Resolver{PreferGo: true, Dial: func(ctx context.Context, network, address string) (net.Conn, error) { d := net.Dialer{} address = "223.5.5.5:53" return d.DialContext(ctx, network, address) }}, }).DialContext, ForceAttemptHTTP2: true, MaxIdleConns: 100, IdleConnTimeout: 90 time.Second, TLSHandshakeTimeout: 10 time.Second, ExpectContinueTimeout: 1 time.Second, }
config := sdk.NewConfig() config.HttpTransport = SpecifiDnsServerTransport
您好,暂时还未有 DialContext 的支持计划。
` 问题代码在: github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go 的方法: func (client *Client) setTimeout(request requests.AcsRequest)
`
调用代码如下:
var SpecifiDnsServerTransport http.Transport = &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 30 time.Second, KeepAlive: 30 time.Second, Resolver: &net.Resolver{PreferGo: true, Dial: func(ctx context.Context, network, address string) (net.Conn, error) { d := net.Dialer{} address = "223.5.5.5:53" return d.DialContext(ctx, network, address) }}, }).DialContext, ForceAttemptHTTP2: true, MaxIdleConns: 100, IdleConnTimeout: 90 time.Second, TLSHandshakeTimeout: 10 time.Second, ExpectContinueTimeout: 1 time.Second, }