Visual RFC.
ALL RFCs / RFC 1928
Read the RFC ↗
RFC 1928 / SOCKS PROXY RELAY

Encode the target and its address type

02

A request names a command and target address. ATYP tells the receiver how many address bytes to read.

RFC 1928 · § 4EXAMPLE
3 / 3
Encode the target and its address typeThree request anatomy examples after completed no-auth negotiation. Header VER05 CMD01 RSV00 is followed by ATYP01 plus four IPv4 octets, or ATYP03 plus one name-length octet0B and eleven ASCII example.org octets without NUL, or ATYP04 plus sixteen IPv6 octets. Port443 follows the address as01 BB, high byte first. Field sizes are labeled but drawing widths are schematic. Domain conversion, resolution and authorization are outside this encoder.CONNECT request · schematic fieldsVER CMD RSV ATYP05 01 00 04DST.ADDR: sixteen octets20 01 0D B8 … 00 202001:db8::20address boundary → two port bytesDST.PORT: 01 BB = 443
03
Read a sixteen-byte IPv6 target.

ATYP04 reserves sixteen address octets for2001:db8::20 before the same two-byte port. Do not use the IPv4 four-byte boundary for this field.

Source for this drawing: RFC 1928 · Read RFC section 4 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A request starts a conversation.

A client asks for a resource. A server sends a response. The method, address, headers, and status explain what that conversation means.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Address type determines the address boundary.

  • The request fields are VER, CMD, RSV, ATYP, DST.ADDR and two-byte DST.PORT. VER=05 and RSV=00. Commands are CONNECT01, BIND02 and UDP ASSOCIATE03.
  • ATYP01 carries four IPv4 address octets; ATYP04 carries sixteen IPv6 address octets. ATYP03 carries one length octet followed by that many domain-name octets, with no terminating NUL.
  • DST.PORT and reply BND.PORT use network octet order: most significant byte first. If the negotiated method supplies integrity/confidentiality encapsulation, requests MUST use that encapsulation.
DETAILS

The layout is schematic, not proportional byte widths. The examples show an unencapsulated no-auth CONNECT request to port443, encoded01 BB. Target ports and addresses are chosen examples, not authorization decisions. The domain example.org occupies11 ASCII octets; internationalized domain processing and DNS resolution details are outside this bounded encoder.

Read the RFC section ↗

All chapters in RFC 1928

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗