Documentation ¶
Index ¶
Constants ¶
const ( AtypIPv4 = 1 AtypDomainName = 3 AtypIPv6 = 4 )
SOCKS address types as defined in RFC 1928 section 5.
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) )
SOCKS errors as defined in RFC 1928 section 6.
const MaxAddrLen = 1 + 1 + 255 + 2
MaxAddrLen is the maximum size of SOCKS address in bytes.
const MaxAuthLen = 255
MaxAuthLen is the maximum size of user/password field in SOCKS5 Auth
Variables ¶
var ErrAuth = errors.New("auth failed")
Auth errors used to return a specific "Auth failed" error
Functions ¶
func ServerHandshake ¶
func ServerHandshake(rw net.Conn, authenticator auth.Authenticator) (addr Addr, command Command, err error)
ServerHandshake fast-tracks SOCKS initialization to get target address to connect on server side.
Types ¶
type Addr ¶
type Addr []byte
Addr represents a SOCKS address as defined in RFC 1928 section 5.
func ClientHandshake ¶
ClientHandshake fast-tracks SOCKS initialization to get target address to connect on client side.
func DecodeUDPPacket ¶
DecodeUDPPacket split `packet` to addr payload, and this function is mutable with `packet`
type Command ¶
type Command = uint8
Command is request commands as defined in RFC 1928 section 4.
SOCKS request commands as defined in RFC 1928 section 4.