Go 增加ReverseProxy的等待时间
我的客户正在使用ReverseProxy调用另一个服务,该服务最多需要60秒来响应我的请求。但我的客户只等了30-35秒。我需要增加60秒的等待时间。我该怎么做呢?您可能正在使用(默认超时为30秒) 尝试添加类似以下内容以设置超时:Go 增加ReverseProxy的等待时间,go,Go,我的客户正在使用ReverseProxy调用另一个服务,该服务最多需要60秒来响应我的请求。但我的客户只等了30-35秒。我需要增加60秒的等待时间。我该怎么做呢?您可能正在使用(默认超时为30秒) 尝试添加类似以下内容以设置超时: reverseproxy.Transport=&http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout
reverseproxy.Transport=&http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 60 * time.Second,
KeepAlive: 60 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
}
您可能正在使用(默认超时为30秒) 尝试添加类似以下内容以设置超时:
reverseproxy.Transport=&http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 60 * time.Second,
KeepAlive: 60 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
}
够了
这就足够了将超时时间增加到60秒,但仍然没有working@avinash显示一些代码,这样这里的人可能会帮助您增加超时时间并保持60秒,但仍然没有working@avinash显示一些代码,以便这里的人可以帮助您