Script Valley
HTTP & The Web: How It Actually Works
How the Internet Moves DataLesson 1.1

What happens when you type a URL and hit Enter

URL anatomy, DNS lookup, TCP connection, HTTP request, server response, browser rendering pipeline

The Full Request Journey

URL to page journey diagram

When you hit Enter on a URL, six distinct things happen in sequence. Most developers know the high level โ€” few know the detail that matters for debugging.

Step-by-step breakdown

1. URL parsed. The browser splits the URL into protocol (https), hostname (example.com), path (/page), and query string. Each part drives a different decision.

2. DNS resolution. The hostname is not an IP address. The OS checks its local cache first, then queries a DNS resolver (usually your router or ISP) which walks the DNS tree until it finds the authoritative answer.

3. TCP connection. The browser opens a TCP socket to port 443 (HTTPS) or 80 (HTTP) at the resolved IP. This costs one round-trip for the SYN/SYN-ACK/ACK handshake before any data moves.

4. TLS handshake (HTTPS only). Another 1โ€“2 round-trips negotiate encryption. HTTP/2 folds this together; HTTP/3 over QUIC does it in 0-RTT.

5. HTTP request sent. The browser writes a request message โ€” verb, path, headers โ€” and sends it over the socket.

6. Response received. The server sends back a status line, headers, and body. The browser starts rendering as bytes arrive.

# Observe this with curl -v
curl -v https://example.com
# Watch: DNS, TCP connect, TLS handshake, GET, response headers

Every performance problem maps to one of these six steps. Know which step is slow before optimizing.

Up next

How DNS resolution actually works step by step

Sign in to track progress

What happens when you type a URL and hit Enter โ€” How the Internet Moves Data โ€” HTTP & The Web: How It Actually Works โ€” Script Valley โ€” Script Valley