import "golang.org/x/net/proxy"
Package proxy provides support for a variety of protocols to proxy network data.
direct.go per_host.go proxy.go socks5.go
var Direct = direct{}
Direct is a direct proxy: one that makes network connections directly.
RegisterDialerType takes a URL scheme and a function to generate Dialers from a URL with that scheme and a forwarding Dialer. Registered schemes are used by FromURL.
Auth contains authentication parameters that specific Dialers may require.
type Dialer interface { // Dial connects to the given address via the proxy. Dial(network, addr string) (c net.Conn, err error) }
A Dialer is a means to establish a connection.
FromEnvironment returns the dialer specified by the proxy related variables in the environment.
FromURL returns a Dialer given a URL specification and an underlying Dialer for it to make network requests.
SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address with an optional username and password. See RFC 1928.
type PerHost struct {
// contains filtered or unexported fields
}
A PerHost directs connections to a default Dialer unless the hostname requested matches one of a number of exceptions.
NewPerHost returns a PerHost Dialer that directs connections to either defaultDialer or bypass, depending on whether the connection matches one of the configured rules.
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 hostname (localhost). A best effort is made to parse the string and errors are ignored.
AddHost specifies a hostname that will use the bypass proxy.
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.
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.
AddZone specifies a DNS suffix that will use the bypass proxy. A zone of "example.com" matches "example.com" and all of its subdomains.
Dial connects to the address addr on the given network through either defaultDialer or bypass.
Package proxy imports 7 packages (graph) and is imported by 52 packages. Updated 6 days ago. Refresh now. Tools for package owners.