Skip to content
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: doesn't allow custom Dialers #13455

Closed
nathanleclaire opened this issue Dec 2, 2015 · 2 comments
Closed

x/net/proxy: doesn't allow custom Dialers #13455

nathanleclaire opened this issue Dec 2, 2015 · 2 comments

Comments

@nathanleclaire
Copy link

If desired to use a custom Dialer as the inner, direct Dialer in the proxy package, for instance to use a net.Dialer with a configured timeout, it is not possible to use the convenience wrappers such as DialerFromEnvironment with a customized inner Dialer.

Perhaps https://github.com/golang/net/blob/master/proxy/direct.go#L14 could be changed so that Direct is an instance of type Dialer interface, not a type direct struct, and consequently users could set it however they like? Or, the dialers in PerHost (https://github.com/golang/net/blob/master/proxy/per_host.go#L15) could be exposed for modification after return from a function such as ProxyFromEnvironment.

@nathanleclaire nathanleclaire changed the title proxy package at golang.org/x/net/proxy doesn't allow custom Dialers golang.org/x/net/proxy doesn't allow custom Dialers Dec 2, 2015
@nathanleclaire nathanleclaire changed the title golang.org/x/net/proxy doesn't allow custom Dialers x/net/proxy doesn't allow custom Dialers Dec 2, 2015
@nathanleclaire nathanleclaire changed the title x/net/proxy doesn't allow custom Dialers x/net/proxy: doesn't allow custom Dialers Dec 2, 2015
@rakyll rakyll added this to the Unreleased milestone Dec 2, 2015
@dweomer
Copy link

dweomer commented May 1, 2019

@nathanleclaire I think golang/net#38 effectively addresses this issue by implementing checks for a DialContext receiver and using it if available. I realize that this is almost 4 years old now but if you could verify that would be helpful.

@gopherbot
Copy link

Change https://golang.org/cl/168921 mentions this issue: proxy: add Dial (with context)

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
@golang golang locked and limited conversation to collaborators May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants