Documentation ¶
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 ( Succeeded = 0 ErrGeneralFailure = 1 ErrConnectionNotAllowed = 2 ErrNetworkUnreachable = 3 ErrHostUnreachable = 4 ErrConnectionRefused = 5 ErrTTLExpired = 6 ErrCommandNotSupported = 7 ErrAddressNotSupported = 8 )
SOCKS errors as defined in RFC 1928 section 6.
View Source
const ( SocksAddressIPv4Length = 1 + net.IPv4len + 2 SocksAddressIPv6Length = 1 + net.IPv6len + 2 // MaxAddrLen is the maximum size of SOCKS address in bytes. MaxAddrLen = 1 + 1 + 255 + 2 )
Variables ¶
This section is empty.
Functions ¶
func ReadAddr ¶
ReadAddr reads just enough bytes from r to get a valid Addr.
The destination slice must be big enough to hold the socks address. Otherwise, this function might panic.
Types ¶
type Addr ¶
type Addr []byte
Addr represents a SOCKS address as defined in RFC 1928 section 5.
func AddrFromReader ¶
AddrFromReader allocates and reads a socks address from an io.Reader.
To avoid allocation, use ReadAddr instead.
func ParseAddr ¶
ParseAddr parses an address string into a socks address.
To avoid allocation, use WriteAddr instead.
Click to show internal directories.
Click to hide internal directories.