-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/net/proxy: provide DialContext #17759
Comments
I don't remember that code, but sounds reasonable. |
I need this as well so I can try to implement context support for cancelation in this package. I'd like to discuss API changes before doing any implementation. My conservative proposal (hopefully completely backwards-compatible) is to leave Dialer interface unchanged and introduce new interface:
Then all functions of this package that take Dialer argument and return Dialer may be changed to return ContextDialer type instead and do type assertion on passed Dialer argument value to check whether it implements ContextDialer. As example, FromURL signature would change from:
to
|
Possible duplicate of #19354. /cc @bradfitz |
CL https://golang.org/cl/38278 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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
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
With go1.7, the
net
package now provides a DialContext function. This is the recommended way to usehttp.Transport
.x/net/proxy
should do the same so we can use it when creating ourhttp.Transport
s for use with SOCKS proxies.The text was updated successfully, but these errors were encountered: