-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/proxy: does not support dialing with a given Context #19354
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
Comments
The net/http use of socks5 proxy is new in master - wasn't present in go 1.8 - sorry I forgot to mention that in the initial comment. |
CL https://golang.org/cl/37641 mentions this issue. |
CL https://golang.org/cl/38278 mentions this issue. |
CL https://golang.org/cl/41031 mentions this issue. |
This change factors out the code related to SOCKS protocol version 5 from the golang/x/net/proxy package and provides new SOCKS-specific API to fix the following: - inflexbility of forward proxy connection setup; e.g., no support for context-based deadline or canceling, no support for dial deadline, no support for working with external authentication mechanisms, - useless error values for troubleshooting. The new package socks is supposed to be used by the net/http package of standard library and proxy package of golang.org/x/net repository. Fixes golang/go#11682. Updates golang/go#17759. Updates golang/go#19354. Updates golang/go#19688. Fixes golang/go#21333. Change-Id: I24098ac8522dcbdceb03d534147c5101ec9e7350 Reviewed-on: https://go-review.googlesource.com/38278 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This change replaces the vendored socks client implementation with the bundle of golang.org/x/net/internal/socks package which contains fixes for 19354 and 11682. golang.org/x/net/internal/socks becomes socks_bundle.go. At git rev 61147c4. (golang.org/cl/38278) Updates #11682. Updates #18508. Updates #19354. Fixes #19688. Updates #21333. Change-Id: I8cf6c3f5eb87c24685a7592be015729f84fbed77 Reviewed-on: https://go-review.googlesource.com/41031 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
From Go 1.11, the net/http package supports SOCKS dialing with contexts. This issue is just for the x/net/proxy package. |
I updated the CL at https://go-review.googlesource.com/c/net/+/37641 to address this. The required change is now much simpler, thanks to the new internal socks package that already supports Contexts, but the issue of full backwards compatibility still needs a definitive decision it seems. |
What about var d net.Dialer
d.DialContext(ctx, network, address) |
Change https://golang.org/cl/168921 mentions this issue: |
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
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
The x/net/proxy package doesn't support dialing a proxy with a given Context.
This also impacts the net/http package because a Client can dial through a socks5 proxy if specified (usualy through ProxyFromEnvironment). If the socks5 proxy blocks before connecting the socket, the http Client could get stuck without a way to abort the connection by cancelling a Context.
The text was updated successfully, but these errors were encountered: