VB6 中 使用Winsock穿越各种代理的实现(TCP协议)[3]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

Once the method-dependent subnegotiation has completed, the client
   sends the request details.  If the negotiated method includes
   encapsulation for purposes of integrity checking and/or
   confidentiality, these requests MUST be encapsulated in the method-
   dependent encapsulation.

   The SOCKS request is formed as follows:

        +----+-----+-------+------+----------+----------+
        |VER | CMD |  RSV  | ATYP | DST.ADDR | DST.PORT |
        +----+-----+-------+------+----------+----------+
        | 1  |  1  | X'00' |  1   | Variable |    2     |
        +----+-----+-------+------+----------+----------+

     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:

本文关键:VB6 中 使用Winsock穿越各种代理的实现(TCP协议)
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top