Documentation ¶
Index ¶
Constants ¶
View Source
const ( Version5 byte = 0x05 //SOCKS5 的版本号,固定为 0x05。 Version4 byte = 0x04 //SOCKS5 的版本号,固定为 0x05。 Reserved byte = 0x00 //保留字段,固定为 0x00。 ReplySuccess byte = 0x00 //成功应答 )
View Source
const ( CmdConnect = 0x01 //客户端通过代理服务器与目标服务器建立一个 TCP 连接 CmdBind = 0x02 //用于服务器模式下的连接。这个命令允许客户端告诉代理服务器监听特定端口 CmdUDPAssociate = 0x03 //此命令用于通过 SOCKS5 代理发送和接收 UDP 数据报 )
socks5 request commands
View Source
const ( ATypeIPv4 = 0x01 //IPv4 地址(4 字节) ATypeDomain = 0x03 //域名(第一个字节是域名长度,后跟域名字符串) ATypeIPV6 = 0x04 //IPv6 地址(16 字节) )
View Source
const ( MaxAddrLen = 1 + 1 + 255 + 2 MaxReqLen = 1 + 1 + 1 + MaxAddrLen )
View Source
const ( ErrGeneralFailure = Error(1) //General SOCKS server failure ErrConnectionNotAllowed = Error(2) //Connection not allowed by ruleset ErrNetworkUnreachable = Error(3) //Network unreachable ErrHostUnreachable = Error(4) //Host unreachable ErrConnectionRefused = Error(5) //Connection refused ErrTTLExpired = Error(6) //TTL expired ErrCommandNotSupported = Error(7) //Command not supported ErrAddressNotSupported = Error(8) //Address type not supported ErrUdpAssociate = Error(9) //udp associate )
SOCKS errors as defined in RFC 1928 section 6.
View Source
const ( MethodNoAuth = 0x00 //表示无需认证 MethodAuth = 0x02 //表示用户名/密码认证 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Addr ¶
type Addr []byte
Click to show internal directories.
Click to hide internal directories.