package proxy
Import Path
golang.org/x/net/proxy (on go.dev)
Dependency Relation
imports 9 packages, and imported by 2 packages
Involved Source Files
dial.go
direct.go
per_host.go
Package proxy provides support for a variety of protocols to proxy network
data.
socks5.go
Package-Level Type Names (total 4)
Auth contains authentication parameters that specific Dialers may require.
Password string
User string
func SOCKS5(network, address string, auth *Auth, forward Dialer) (Dialer, error)
A ContextDialer dials using a context.
( ContextDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)
*PerHost
*golang.org/x/net/internal/socks.Dialer
*golang.org/x/crypto/ssh.Client
*crypto/tls.Dialer
github.com/libp2p/go-libp2p/p2p/transport/tcp.ContextDialer (interface)
*net.Dialer
ContextDialer : github.com/libp2p/go-libp2p/p2p/transport/tcp.ContextDialer
A Dialer is a means to establish a connection.
Custom dialers should also implement ContextDialer.
( Dialer) Dial(network, address string) (net.Conn, error)
*PerHost
*golang.org/x/net/internal/socks.Dialer
*golang.org/x/crypto/ssh.Client
*crypto/tls.Dialer
github.com/nats-io/nats.go.CustomDialer (interface)
github.com/pion/transport/v2.Dialer (interface)
github.com/pion/transport/v2.Net (interface)
*github.com/pion/transport/v2/stdnet.Net
github.com/pion/transport/v3.Dialer (interface)
github.com/pion/transport/v3.Net (interface)
*github.com/pion/transport/v3/stdnet.Net
*github.com/pion/transport/v3/vnet.Net
*github.com/pion/turn/v4/internal/client.TCPAllocation
*net.Dialer
Dialer : github.com/nats-io/nats.go.CustomDialer
Dialer : github.com/pion/transport/v2.Dialer
Dialer : github.com/pion/transport/v3.Dialer
func FromEnvironment() Dialer
func FromEnvironmentUsing(forward Dialer) Dialer
func FromURL(u *url.URL, forward Dialer) (Dialer, error)
func SOCKS5(network, address string, auth *Auth, forward Dialer) (Dialer, error)
func FromEnvironmentUsing(forward Dialer) Dialer
func FromURL(u *url.URL, forward Dialer) (Dialer, error)
func NewPerHost(defaultDialer, bypass Dialer) *PerHost
func SOCKS5(network, address string, auth *Auth, forward Dialer) (Dialer, error)
func github.com/pion/webrtc/v4.(*SettingEngine).SetICEProxyDialer(d Dialer)
A PerHost directs connections to a default Dialer unless the host name
requested matches one of a number of exceptions.
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.
AddHost specifies a host name 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.
DialContext connects to the address addr on the given network through either
defaultDialer or bypass.
*PerHost : ContextDialer
*PerHost : Dialer
*PerHost : github.com/libp2p/go-libp2p/p2p/transport/tcp.ContextDialer
*PerHost : github.com/nats-io/nats.go.CustomDialer
*PerHost : github.com/pion/transport/v2.Dialer
*PerHost : github.com/pion/transport/v3.Dialer
func NewPerHost(defaultDialer, bypass Dialer) *PerHost
Package-Level Functions (total 7)
Dial works like DialContext on net.Dialer but using a dialer returned by FromEnvironment.
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.
A Conn returned from a successful Dial after the context has been cancelled will be immediately closed.
FromEnvironment returns the dialer specified by the proxy-related
variables in the environment and makes underlying connections
directly.
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).
FromURL returns a Dialer given a URL specification and an underlying
Dialer for it to make network requests.
NewPerHost returns a PerHost Dialer that directs connections to either
defaultDialer or bypass, depending on whether the connection matches one of
the configured rules.
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.
SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given
address with an optional username and password.
See RFC 1928 and RFC 1929.
Package-Level Variables (only one)
Direct implements Dialer by making network connections directly using net.Dial or net.DialContext.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |