Skip to content

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

@nathanleclaire

Description

@nathanleclaire

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions