-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/proxy: Dialer.Dial doesn't have a timeout #27874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
Any updates? |
Try this func Client(socks, addr string) (net.Conn, error) {
dialer, err := proxy.SOCKS5("tcp", socks, nil, &net.Dialer{Timeout: 3 * time.Second})
if err != nil {
return nil, err
}
conn, err := dialer.Dial("tcp", addr)
if err != nil {
return nil, err
}
return conn, err
} |
Change https://golang.org/cl/168921 mentions this issue: |
dweomer
added a commit
to dweomer/golang-net
that referenced
this issue
May 1, 2019
The existing API does not allow client code to take advantage of Dialer implementations that implement DialContext receivers. This a familiar API, see net.Dialer. Fixes golang/go#27874 Fixes golang/go#19354 Fixes golang/go#17759 Fixes golang/go#13455
dweomer
added a commit
to dweomer/golang-net
that referenced
this issue
May 2, 2019
The existing API does not allow client code to take advantage of Dialer implementations that implement DialContext receivers. This a familiar API, see net.Dialer. Fixes golang/go#27874 Fixes golang/go#19354 Fixes golang/go#17759 Fixes golang/go#13455
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.1 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?macOS 10.13, amd64
What did you do?
Try to use proxy.SOCKS5 for making connection via a proxy
What did you expect to see?
proxy.Dialer.Dial should have a timeout
net.Dial has a timeout but proxy.Dialer.Dial doesn't have a timeout. I guess behaviour is similar in both cases, so it would be nice to have a timeout for proxy as well.
Would be nice if there is a workaround as well, would be open to trying them out. Thanks!
The text was updated successfully, but these errors were encountered: