← Computer Networksภาษาไทย

APPLICATION LAYER · HTTP/1.1 MESSAGE

Read what the browser and server say.

Telnet once made HTTP visible, but most public sites now require TLS. This laboratory exposes the plaintext message immediately before encryption and after decryption, so every space, CRLF and empty line can be inspected safely.

MESSAGE COMPOSER

Compose a request; walk through the exchange

CLIENTBrowser192.0.2.10:53124
HTTP

Ready to compose

SERVERwarin.me203.0.113.20:443
REQUEST0 bytes
Client → server
    RESPONSE0 bytes
    Server → client
      Select a lineClick any visible message line to inspect its role.

      FROM SOCKET TO MESSAGE

      What telnet used to reveal—and what HTTPS hides

      1

      TCP connection

      HTTP/1.1 rides on a byte stream. The connection has addresses and ports, but TCP does not understand request lines or headers.

      2

      TLS tunnel

      With HTTPS, TLS encrypts the HTTP bytes. Telnet cannot negotiate modern TLS, while the browser sees plaintext before encryption.

      3

      HTTP semantics

      Method and target express intent; headers carry metadata; the empty line ends the header section; an optional body carries representation data.

      MESSAGE ANATOMY

      Grammar that students can point to

      GET /path HTTP/1.1

      Request line

      Method, one space, request target, one space, protocol version, then CRLF.

      Host: warin.me

      Header field

      A field name, colon, optional whitespace and a value. HTTP field names are case-insensitive.

      ␍␊

      Empty line

      A second CRLF ends the header section. Omitting it was the classic reason a telnet request appeared to hang.

      {"student":"A"}

      Message body

      Content-Length counts body bytes, not JavaScript characters. UTF-8 text can use more than one byte per character.

      DO NOT OVERGENERALIZE

      This is HTTP/1.1—not every HTTP wire format

      ProtocolWire representationConnection behaviorHow to inspect
      HTTP/1.1Text start-line and fields; CRLF delimitersPersistent by default; pipelining is rarecurl -v, DevTools, Wireshark + TLS keys
      HTTP/2Binary frames with compressed header blocksMany streams multiplexed on one connectionDevTools, nghttp, Wireshark
      HTTP/3HTTP semantics over QUIC framesStreams over encrypted UDP-based QUICDevTools, qlog, Wireshark

      CLASSROOM INVESTIGATION

      Experiments that turn syntax into evidence

      1. Change GET to POST. Which fields must change when a body appears?
      2. Enter Thai text in the body. Compare character count with Content-Length bytes.
      3. Compare 200, 301, 304 and 404. Which responses carry a representation body?
      4. Use Connection: close and explain who ends the connection after the response.
      5. Explain why the simulator can show plaintext although the public URL uses HTTPS.
      6. Capture the same request in Browser DevTools and identify which headers the browser adds automatically.