Documentation ¶
Overview ¶
Package socks implements essential parts of SOCKS protocol.
Index ¶
Constants ¶
View Source
const ( CmdConnect = 1 CmdBind = 2 CmdUDPAssociate = 3 )
SOCKS request commands as defined in RFC 1928 section 4.
View Source
const ( AtypIPv4 = 1 AtypDomainName = 3 AtypIPv6 = 4 )
SOCKS address types as defined in RFC 1928 section 5.
View Source
const ( ErrGeneralFailure = Error(1) ErrConnectionNotAllowed = Error(2) ErrNetworkUnreachable = Error(3) ErrHostUnreachable = Error(4) ErrConnectionRefused = Error(5) ErrTTLExpired = Error(6) ErrCommandNotSupported = Error(7) ErrAddressNotSupported = Error(8) InfoUDPAssociate = Error(9) )
SOCKS errors as defined in RFC 1928 section 6.
View Source
const MaxAddrLen = 1 + 1 + 255 + 2
MaxAddrLen is the maximum size of SOCKS address in bytes.
Variables ¶
View Source
var UDPEnabled = false
UDPEnabled is the toggle for UDP support
Functions ¶
This section is empty.
Types ¶
type Addr ¶
type Addr []byte
Addr represents a SOCKS address as defined in RFC 1928 section 5.
func Handshake ¶
func Handshake(rw io.ReadWriter) (Addr, error)
Handshake fast-tracks SOCKS initialization to get target address to connect.
Click to show internal directories.
Click to hide internal directories.