Documentation
¶
Overview ¶
Package proxy is a library based on golang.org/x/net/proxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
Dial works like DialContext on Dialer with a fallback in case provided Dialer is not a ContextDialer.
The passed ctx is only used for returning the Conn, not the lifetime of the Conn.
Custom dialers (registered via RegisterDialerType) that do not implement ContextDialer can leak a goroutine for as long as it takes the underlying Dialer implementation to timeout.
Types ¶
type ContextDialer ¶
type ContextDialer interface {
DialContext(ctx context.Context, network, addr string) (net.Conn, error)
}
A ContextDialer dials using a context.
type Dialer ¶
A Dialer is a means to establish a connection. Custom dialers should also implement ContextDialer.
var Direct Dialer = proxy_Direct
Direct implements Dialer by making network connections directly using net.Dial or net.DialContext.
func FromEnvironment ¶
func FromEnvironment() Dialer
FromEnvironment returns the dialer specified by the proxy-related variables in the environment and makes underlying connections directly.
func FromEnvironmentUsing ¶
FromEnvironmentUsing returns the dialer specify by the proxy-related variables in the environment and makes underlying connections using the provided forwarding Dialer (for instance, a *net.Dialer with desired configuration).