Documentation ¶
Index ¶
Constants ¶
View Source
const ( ResolvePreferenceDefault = ResolvePreference(iota) ResolvePreferenceIPv4 ResolvePreferenceIPv6 ResolvePreferenceIPv4OrIPv6 ResolvePreferenceIPv6OrIPv4 ResolveTimeout = 8 * time.Second )
Variables ¶
View Source
var DefaultClientTransport = &ClientTransport{ Dialer: &net.Dialer{ Timeout: 8 * time.Second, }, ResolvePreference: ResolvePreferenceDefault, }
View Source
var DefaultServerTransport = &ServerTransport{ Dialer: &net.Dialer{ Timeout: 8 * time.Second, }, ResolvePreference: ResolvePreferenceDefault, }
Functions ¶
This section is empty.
Types ¶
type AddrEx ¶
AddrEx is like net.TCPAddr or net.UDPAddr, but with additional domain information for SOCKS5. At least one of Domain and IPAddr must be non-empty.
type ClientTransport ¶
type ClientTransport struct { Dialer *net.Dialer ResolvePreference ResolvePreference }
func (*ClientTransport) ResolveIPAddr ¶
func (ct *ClientTransport) ResolveIPAddr(address string) (*net.IPAddr, error)
type ResolvePreference ¶
type ResolvePreference int
func ResolvePreferenceFromString ¶
func ResolvePreferenceFromString(preference string) (ResolvePreference, error)
type SOCKS5Client ¶
type SOCKS5Client struct { ServerTCPAddr *net.TCPAddr Username string Password string NegTimeout time.Duration }
func NewSOCKS5Client ¶
func (*SOCKS5Client) ListenUDP ¶
func (c *SOCKS5Client) ListenUDP() (STPacketConn, error)
type STPacketConn ¶ added in v1.2.2
type ServerTransport ¶
type ServerTransport struct { Dialer *net.Dialer SOCKS5Client *SOCKS5Client ResolvePreference ResolvePreference LocalUDPAddr *net.UDPAddr LocalUDPIntf *net.Interface }
func (*ServerTransport) DialTCP ¶
func (st *ServerTransport) DialTCP(raddr *AddrEx) (*net.TCPConn, error)
func (*ServerTransport) ListenUDP ¶
func (st *ServerTransport) ListenUDP() (STPacketConn, error)
func (*ServerTransport) ProxyEnabled ¶ added in v1.2.2
func (st *ServerTransport) ProxyEnabled() bool
func (*ServerTransport) ResolveIPAddr ¶
Click to show internal directories.
Click to hide internal directories.