Documentation ¶
Overview ¶
Package socks5 implements a SOCKS5 client/server. For more information see RFC 1928 and RFC 1929.
Notes:
- GSSAPI authentication, is NOT supported.
- The authentication provided by the client is always accepted.
- A lot of the code is shamelessly stolen from obfs4proxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
Address is a SOCKS 5 address + port.
func (*Address) FromString ¶
FromString parses the provided "host:port" format address and populates the Address fields.
type ReplyCode ¶
type ReplyCode byte
ReplyCode is a SOCKS 5 reply code.
const ( ReplySucceeded ReplyCode = iota ReplyGeneralFailure ReplyConnectionNotAllowed ReplyNetworkUnreachable ReplyHostUnreachable ReplyConnectionRefused ReplyTTLExpired ReplyCommandNotSupported ReplyAddressNotSupported )
The various SOCKS 5 reply codes from RFC 1928.
func ErrorToReplyCode ¶
ErrorToReplyCode converts an error to the "best" reply code.
type Request ¶
type Request struct { Auth AuthInfo Cmd Command Addr Address // contains filtered or unexported fields }
Request describes a SOCKS 5 request.
func Handshake ¶
Handshake attempts to handle a incoming client handshake over the provided connection and receive the SOCKS5 request. The routine handles sending appropriate errors if applicable, but will not close the connection.
Click to show internal directories.
Click to hide internal directories.