bsp; +----+-----+-------+------+----------+----------+
Where:
o VER protocol version: X''''05'''' ------------- 固定 05
o CMD
o CONNECT X''''01'''' ------------- TCP方式 01
o BIND X''''02''''
o UDP ASSOCIATE X''''03'''' ------------- UDP方式 03
o RSV RESERVED ------------- 固定 00
o ATYP address type of following address
o IP V4 address: X''''01'''' ------------- IPv4 01
o DOMAINNAME: X''''03''''
o IP V6 address: X''''04''''
o DST.ADDR desired destination address
o DST.PORT desired destination port in network octet
order
The SOCKS server will typically evaluate the request based on source
and destination addresses, and return one or more reply messages, as
appropriate for the request type.
发送 05 01 00 01 + 目的地址(4字节) + 目的端口(2字节),目的地址和端口都是16进制码(不是字符串)。
例202.103.190.27 - 7201
则发送的信息为:05 01 00 01 CA 67 BE 1B 1C 21
(CA=202 67=103 BE=190 1B=27 1C21=7201)
关于我是怎么把16进制码换成10进制的,请自己看
程序最后,接受服务器返回数据,看RFC:
+----+-----+-------+------+----------+----------+