3.9.5.1.2 Connect Request

The ConnectionState MUST be "Negotiated". Otherwise, it is a protocol error and the SOCKS connection MUST be closed, as specified in section 3.9.4.2.

The client sets ConnectionState to "Connecting".

The client constructs the SOCKS connect request as specified in [RFC1928], section 4.

The client sets the DEST.ADDR field with the value of the ServerHost state variable and the DEST.PORT field with the value of the ServerPort state variable.

The client MUST set "CONNECT [0x01]" as the CMD identifier.

The client SHOULD set "DOMAINNAME [0x03]" as the ATYP identifier.

The client sends a connect request.