Chapter Index

HTTP Servers, Clients & Proxies

7 topics in this chapter

7Topics
01
Topic

HTTP/1.1 Wire Format

Read HTTP/1.1 as bytes: start lines, headers, body framing, chunked transfer coding, connection rules, and interim responses.

nodejshttphttp11networkingprotocols
41 min read
02
Topic

http.Server Lifecycle

Trace one inbound HTTP request through http.Server, accepted sockets, IncomingMessage, ServerResponse, header commits, early bodies, parser errors, timeouts, and connection reuse.

nodejshttpserverrequestresponse
39 min read
03
Topic

HTTP Parsing with llhttp

How Node.js turns HTTP/1.1 bytes into IncomingMessage objects through llhttp state, parser callbacks, header limits, body delivery, errors, trailers, and upgrade handoff.

nodejshttpllhttpparsinghttp1
37 min read
04
Topic

Routing and Middleware

Build a small framework-free HTTP handler with method and path routing, middleware composition, bounded JSON body parsing, and deliberate error responses.

nodejshttproutingmiddleware
40 min read
05
Topic

Keep-Alive, Agents, and Pools

How Node.js reuses HTTP/1.1 TCP connections through keep-alive, http.Agent pools, server idle timers, stale pooled sockets, and reuse limits.

nodejshttpkeep-aliveagentsconnection-pooling
36 min read
06
Topic

fetch and Undici

How outbound HTTP works in Node.js, from http.request() and ClientRequest through fetch, Undici dispatchers, pools, redirects, decoding, and pipelining.

nodejshttpfetchundicihttp-client
40 min read
07
Topic

Proxies, Static Files, and Streaming

Build the HTTP boundary where Node forwards requests, streams bodies, filters connection metadata, and serves file-backed responses.

nodejshttpproxiesstreamsstatic-files
39 min read