Hi.
I try to make request to remote host through socks5 proxy, but have problem with timeout.
Seems like timeout that I’ve set was ignored, because application stuck for 2 minutes
I have next code
dialer, socks_err := proxy.SOCKS5("tcp", proxyAddr,
nil,
&net.Dialer {
Timeout: time.Second * 5,
},
)
if err != nil {
fmt.Println("can't connect to the proxy:", err)
return
}
connection, err = dialer.Dial("tcp", "google.com:43") // here is application stuck and after 2 minutes I see error "i/o timeout"
fmt.Println(err)
Seems like timeout, that I’ve set, works only with connection to proxy server, but not works with connection to remote host.
How can I set timeout for remote host connection/request?
Thanks!