{"modulePath":"code.cloudfoundry.org/cli","version":"v6.1.1+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package proxy\n\nPackage proxy provides support for a variety of protocols to proxy network data.\n\n## Variables\n\n```go\nvar Direct = direct{}\n```\nDirect is a direct proxy: one that makes network connections directly.\n\n## Functions\n\n```go\nfunc RegisterDialerType(scheme string, f func(*url.URL, Dialer) (Dialer, error))\n```\nRegisterDialerType 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.\n\n## Types\n\n```go\ntype Auth struct {\n\tUser, Password string\n}\n```\nAuth contains authentication parameters that specific Dialers may require.\n\n```go\ntype Dialer interface {\n\t// Dial connects to the given address via the proxy.\n\tDial(network, addr string) (c net.Conn, err error)\n}\n```\nA Dialer is a means to establish a connection.\n\n```go\nfunc FromEnvironment() Dialer\n```\nFromEnvironment returns the dialer specified by the proxy related variables in the environment.\n\n```go\nfunc FromURL(u *url.URL, forward Dialer) (Dialer, error)\n```\nFromURL returns a Dialer given a URL specification and an underlying Dialer for it to make network requests.\n\n```go\nfunc SOCKS5(network, addr string, auth *Auth, forward Dialer) (Dialer, error)\n```\nSOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address with an optional username and password. See RFC 1928.\n\n```go\ntype PerHost struct {\n\t// contains filtered or unexported fields\n}\n```\nA PerHost directs connections to a default Dialer unless the hostname requested matches one of a number of exceptions.\n\n```go\nfunc NewPerHost(defaultDialer, bypass Dialer) *PerHost\n```\nNewPerHost returns a PerHost Dialer that directs connections to either defaultDialer or bypass, depending on whether the connection matches one of the configured rules.\n\n```go\nfunc (p *PerHost) AddFromString(s string)\n```\nAddFromString 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.\n\n```go\nfunc (p *PerHost) AddHost(host string)\n```\nAddHost specifies a hostname that will use the bypass proxy.\n\n```go\nfunc (p *PerHost) AddIP(ip net.IP)\n```\nAddIP 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.\n\n```go\nfunc (p *PerHost) AddNetwork(net *net.IPNet)\n```\nAddNetwork 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.\n\n```go\nfunc (p *PerHost) AddZone(zone string)\n```\nAddZone specifies a DNS suffix that will use the bypass proxy. A zone of \"example.com\" matches \"example.com\" and all of its subdomains.\n\n```go\nfunc (p *PerHost) Dial(network, addr string) (c net.Conn, err error)\n```\nDial connects to the address addr on the given network through either defaultDialer or bypass.\n\n","path":"code.cloudfoundry.org/cli/src/code.google.com/p/go.net/proxy","name":"proxy","synopsis":"Package proxy provides support for a variety of protocols to proxy network data.","isRedistributable":true}
