HTTP server timeouts
Node.js HTTP server settings that close connections which stay idle or send their request too slowly.
In more detail
keepAliveTimeout closes idle kept-alive sockets, headersTimeout limits how long the request headers may take, and requestTimeout limits the whole request. Together they protect against slow-client attacks such as Slowloris.
Related terms
- keep-alive — Keeping a TCP connection open after an HTTP response so the same client can send further requests over it.
- Slowloris — A denial-of-service attack that opens many connections and sends each request extremely slowly, so the server runs out of connections for real users.
- node:http — The built-in Node.js module for writing HTTP/1.1 servers and clients, which web frameworks such as Express and Fastify build on.
Taught in
- Native HTTP Server: Request & Response Lifecycles — Node.js Internals & Backend Services