Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = &net.Dialer{}
Used by wrappers of standard library network types.
Functions ¶
This section is empty.
Types ¶
type Socks5 ¶ added in v1.62.0
type Socks5 struct {
// Address of the SOCKS5 proxy, such as "127.0.0.1:1080".
Addr string
// Optional username/password credentials for the proxy.
Auth *proxy.Auth
// The dialer used to connect to the proxy itself. Defaults to
// connecting directly.
Forward T
}
Socks5 dials through a SOCKS5 proxy server (RFC 1928/1929).
func NewSocks5 ¶ added in v1.62.0
NewSocks5 returns a dialer that routes connections through the SOCKS5 proxy at proxyAddr. An auth of nil connects without credentials.
Example ¶
d := NewSocks5("localhost:1080", nil)
// The dialer can be added to a client for outgoing peer connections:
// cl.AddDialer(d)
_ = d
func (*Socks5) DialerNetwork ¶ added in v1.62.0
type WithContext ¶
type WithContext interface {
DialContext(ctx context.Context, network, addr string) (net.Conn, error)
}
An interface to ease wrapping dialers that explicitly include a network parameter.
type WithNetwork ¶
type WithNetwork struct {
Network string
Dialer WithContext
}
Adapts a WithContext to the Dial interface in this package.
func (WithNetwork) DialerNetwork ¶
func (me WithNetwork) DialerNetwork() string
Click to show internal directories.
Click to hide internal directories.