Boost.Socks Logo

PrevUpHomeNext

Username/Password

All SOCKS implementations should support the Username/Password (RFC 1929) authentication method (0x02).

Authentication Request

If the server has agreed with Username/Password authentication, the client should send a message with in following format:

+-----+--------+-----+-------+-----+
| VER | IDLEN  | ID  | PWLEN | PW  |
+-----+--------+-----+-------+-----+
   1      1     1-255    1    1-255

where:

  1. VER: Username/Password protocol version number (1 byte: 0x01)
  2. IDLEN: Username length (1 byte)
  3. ID: Username as bytestring (1-255 bytes)
  4. PWLEN: Password length (1 byte)
  5. PW: Username as bytestring (1-255 bytes)
Authentication Response

The SOCKS server should create an authentication response in the following format:

+-----+--------+
| VER | STATUS |
+-----+--------+
   1      1

where:

  1. VER: Username/Password protocol version number (1 byte: 0x01)
  2. STATUS: 0x00 for success or any other value for failure.

PrevUpHomeNext