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).
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package loadbalance provides load balancing over Dialers.
|
Package loadbalance provides load balancing over Dialers. |
strategy/failover
Package failover provides a load balancing strategy that it tries to pick a reliable Dialer out of many.
|
Package failover provides a load balancing strategy that it tries to pick a reliable Dialer out of many. |
strategy/random
Package random provides a load balancing strategy that randomly picks one Dialer out of many.
|
Package random provides a load balancing strategy that randomly picks one Dialer out of many. |
strategy/roundrobin
Package roundrobin provides a load balancing strategy that cyclically picks one Dialer out of many.
|
Package roundrobin provides a load balancing strategy that cyclically picks one Dialer out of many. |