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: document returned Dialers implement ContextDialer #58376

Open
sjpotter opened this issue Feb 7, 2023 · 1 comment
Open

x/net/proxy: document returned Dialers implement ContextDialer #58376

sjpotter opened this issue Feb 7, 2023 · 1 comment
Labels
Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@sjpotter
Copy link

sjpotter commented Feb 7, 2023

Currently, if one tries to instantiate a socks5 dialer, one receives a response with the proxy.Dialer interface. This interface only exposes the Dial() (context free) method. This method is deprecated in many cases (i.e. http client transports). DialContext() is actually implemented for all the proxies, but is only visible within the internal package, so is not actually usable by end users.

Motivated by golang/net#164 but the comment there is that since that PR changes the proxy.Dialer interface it breaks backwards compatibility (which I assume is if external users use the interface, and not just limited to the proxy package) and therefore should go through the proposal process to determine what API changes should be.

@gopherbot gopherbot added this to the Proposal milestone Feb 7, 2023
@seankhliao
Copy link
Member

Interfaces can't be changed, that breaks backwards compatibility.

golang.org/x/net/proxy already has an interface for this ContextDialer

What can change is documentation to say that all returned dialers can be asserted to ContextDialer

@seankhliao seankhliao changed the title proposal: x/net/proxy provide a Dialer like interface that exposes DialContext() x/net/proxy: document returned Dialers implement ContextDialer Feb 7, 2023
@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed Proposal labels Feb 7, 2023
@seankhliao seankhliao modified the milestones: Proposal, Unreleased Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants