My client is using ReverseProxy to call another service that service takes maximum of 60 seconds to respond to my request. But my client is waiting for only 30-35 seconds. I need to increase the waiting time 60 seconds. How can I do that?
You are probably using the DefaultTransport
(default timeout is 30 seconds)
Transport
for proxy request needs to be set.
Try adding something like this for setting 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,
}