Documentation ¶
Index ¶
- Constants
- Variables
- type AddrEx
- type ClientTransport
- func (ct *ClientTransport) DialTCP(raddr *net.TCPAddr) (*net.TCPConn, error)
- func (ct *ClientTransport) ListenUDP() (*net.UDPConn, error)
- func (ct *ClientTransport) QUICDial(proto string, server string, tlsConfig *tls.Config, quicConfig *quic.Config, ...) (quic.Connection, error)
- func (ct *ClientTransport) ResolveIPAddr(address string) (*net.IPAddr, error)
- type PUDPConn
- type ResolvePreference
- type SOCKS5Client
- type ServerTransport
- func (st *ServerTransport) DialTCP(raddr *AddrEx) (*net.TCPConn, error)
- func (st *ServerTransport) ListenUDP() (PUDPConn, error)
- func (st *ServerTransport) QUICListen(proto string, listen string, tlsConfig *tls.Config, quicConfig *quic.Config, ...) (quic.Listener, error)
- func (st *ServerTransport) ResolveIPAddr(address string) (*net.IPAddr, bool, error)
- func (st *ServerTransport) SOCKS5Enabled() bool
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 ¶ added in v1.0.3
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 ¶ added in v0.9.5
type ClientTransport struct { Dialer *net.Dialer ResolvePreference ResolvePreference }
func (*ClientTransport) ListenUDP ¶ added in v0.9.5
func (ct *ClientTransport) ListenUDP() (*net.UDPConn, error)
func (*ClientTransport) QUICDial ¶ added in v0.9.5
func (ct *ClientTransport) QUICDial(proto string, server string, tlsConfig *tls.Config, quicConfig *quic.Config, obfs obfs.Obfuscator) (quic.Connection, error)
func (*ClientTransport) ResolveIPAddr ¶ added in v0.9.5
func (ct *ClientTransport) ResolveIPAddr(address string) (*net.IPAddr, error)
type ResolvePreference ¶ added in v1.2.0
type ResolvePreference int
func ResolvePreferenceFromString ¶ added in v1.0.2
func ResolvePreferenceFromString(preference string) (ResolvePreference, error)
type SOCKS5Client ¶ added in v1.0.0
type SOCKS5Client struct { ServerTCPAddr *net.TCPAddr Username string Password string NegTimeout time.Duration }
func NewSOCKS5Client ¶ added in v1.0.0
func (*SOCKS5Client) DialTCP ¶ added in v1.0.0
func (c *SOCKS5Client) DialTCP(raddr *AddrEx) (*net.TCPConn, error)
func (*SOCKS5Client) ListenUDP ¶ added in v1.0.0
func (c *SOCKS5Client) ListenUDP() (*socks5UDPConn, error)
type ServerTransport ¶ added in v0.9.5
type ServerTransport struct { Dialer *net.Dialer SOCKS5Client *SOCKS5Client ResolvePreference ResolvePreference LocalUDPAddr *net.UDPAddr LocalUDPIntf *net.Interface }
func (*ServerTransport) DialTCP ¶ added in v0.9.5
func (st *ServerTransport) DialTCP(raddr *AddrEx) (*net.TCPConn, error)
func (*ServerTransport) ListenUDP ¶ added in v0.9.5
func (st *ServerTransport) ListenUDP() (PUDPConn, error)
func (*ServerTransport) QUICListen ¶ added in v0.9.5
func (st *ServerTransport) QUICListen(proto string, listen string, tlsConfig *tls.Config, quicConfig *quic.Config, obfs obfs.Obfuscator) (quic.Listener, error)
func (*ServerTransport) ResolveIPAddr ¶ added in v0.9.5
func (*ServerTransport) SOCKS5Enabled ¶ added in v1.0.3
func (st *ServerTransport) SOCKS5Enabled() bool
Click to show internal directories.
Click to hide internal directories.