Documentation
¶
Index ¶
- Constants
- Variables
- func NewServerAuthMessage(conn io.Writer, method Method) error
- func WriteRequestFailureMessage(conn io.Writer, replyType ReplyType) error
- func WriteRequestSuccessMessage(conn io.Writer, ip net.IP, port uint16) error
- type AddressType
- type ClientAuthMessage
- type ClientRequestMessage
- type Command
- type Method
- type ReplyType
- type Server
- type Socks5Server
Constants ¶
View Source
const ( IPv4Length = 4 IPv6Length = 16 PortLength = 2 )
View Source
const ( SOCKS5_VERSION = 0x05 REVERSED_FIELD = 0x00 )
Variables ¶
View Source
var ( // ErrorVersionNotSupported 不支持的协议版本 ErrorVersionNotSupported = errors.New("protocal version not supported") // ErrorCommandNotSupported 不支持的指令 ErrorCommandNotSupported = errors.New("request command not supported") // ErrorReservedFieldInvalid 不支持的保留字段 ErrorReservedFieldInvalid = errors.New("invalid reserved field") // ErrorAddressTypeNotSupported 不支持的地址类型 ErrorAddressTypeNotSupported = errors.New("address type not supported") )
Functions ¶
Types ¶
type AddressType ¶
type AddressType = byte
const ( TypeIPv4 AddressType = 0x01 TypeDomain AddressType = 0x03 TypeIPv6 AddressType = 0x04 )
type ClientAuthMessage ¶
func NewClientAuthMessage ¶
func NewClientAuthMessage(conn io.Reader) (*ClientAuthMessage, error)
type ClientRequestMessage ¶
type ClientRequestMessage struct { // Version byte Cmd Command AddrType AddressType Address string Port uint16 }
func NewClientRequestMessage ¶
func NewClientRequestMessage(conn io.Reader) (*ClientRequestMessage, error)
type Socks5Server ¶
func (*Socks5Server) Run ¶
func (s *Socks5Server) Run() error
Click to show internal directories.
Click to hide internal directories.