Documentation
¶
Overview ¶
Package proxy provides support for a variety of protocols to proxy network data.
Index ¶
- func DialServerViaCONNECT(ctx context.Context, addr string, proxy *url.URL, forward *net.Dialer) (net.Conn, error)
- func NewSystemProxy(proxyURL string) func(*http.Request) (*url.URL, error)
- func ParseURL(rawURL string, schemePrefix string) (*url.URL, error)
- type Auth
- type Dialer
- type PerHost
- type ProxyFuncValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
User, Password string
}
Auth contains authentication parameters that specific Dialers may require.
type Dialer ¶
type Dialer interface {
DialContext(ctx context.Context, network string, address string) (net.Conn, error)
}
A Dialer is a means to establish a connection. Custom dialers should also implement ContextDialer.
func NewSystemDialer ¶
type PerHost ¶
type PerHost struct {
// contains filtered or unexported fields
}
A PerHost directs connections to a default Dialer unless the host name requested matches one of a number of exceptions.
func NewPerHost ¶
NewPerHost returns a PerHost Dialer that directs connections to either defaultDialer or bypass, depending on whether the connection matches one of the configured rules.
func (*PerHost) AddFromString ¶
AddFromString parses a string that contains comma-separated values specifying hosts that should use the bypass proxy. Each value is either an IP address, a CIDR range, a zone (*.example.com) or a host name (localhost). A best effort is made to parse the string and errors are ignored.
func (*PerHost) AddIP ¶
AddIP specifies an IP address that will use the bypass proxy. Note that this will only take effect if a literal IP address is dialed. A connection to a named host will never match an IP.
func (*PerHost) AddNetwork ¶
AddNetwork specifies an IP range that will use the bypass proxy. Note that this will only take effect if a literal IP address is dialed. A connection to a named host will never match.