diff --git a/doc/api/http.md b/doc/api/http.md index afe08be89cb7c7..cd9bfaf2f64363 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -832,17 +832,33 @@ Returns `server`. added: v0.9.12 --> -* {number} Defaults to 120000 (2 minutes). +* {number} Timeout in milliseconds. Defaults to 120000 (2 minutes). The number of milliseconds of inactivity before a socket is presumed to have timed out. -Note that the socket timeout logic is set up on connection, so -changing this value only affects *new* connections to the server, not -any existing connections. +A value of 0 will disable the timeout behavior on incoming connections. -Set to 0 to disable any kind of automatic timeout behavior on incoming -connections. +*Note*: The socket timeout logic is set up on connection, so changing this +value only affects new connections to the server, not any existing connections. + +### server.keepAliveTimeout + + +* {number} Timeout in milliseconds. Defaults to 5000 (5 seconds). + +The number of milliseconds of inactivity a server needs to wait for additional +incoming data, after it has finished writing the last response, before a socket +will be destroyed. If the server receives new data before the keep-alive +timeout has fired, it will reset the regular inactivity timeout, i.e., +[`server.timeout`][]. + +A value of 0 will disable the keep-alive timeout behavior on incoming connections. + +*Note*: The socket timeout logic is set up on connection, so changing this +value only affects new connections to the server, not any existing connections. ## Class: http.ServerResponse +- {number} Defaults to 5000 (5 seconds). + +See [`http.Server#keepAliveTimeout`][]. + ## https.createServer(options[, requestListener])