Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/api/http.md20
-rw-r--r--doc/api/https.md7
2 files changed, 27 insertions, 0 deletions
diff --git a/doc/api/http.md b/doc/api/http.md
index 9b0be0b61bc..9dc46b13f34 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -882,6 +882,26 @@ added: v0.7.0
Limits maximum incoming headers count. If set to 0 - no limit will be applied.
+### server.headersTimeout
+<!-- YAML
+added: REPLACEME
+-->
+
+* {number} **Default:** `40000`
+
+Limit the amount of time the parser will wait to receive the complete HTTP
+headers.
+
+In case of inactivity, the rules defined in [server.timeout][] apply. However,
+that inactivity based timeout would still allow the connection to be kept open
+if the headers are being sent very slowly (by default, up to a byte per 2
+minutes). In order to prevent this, whenever header data arrives an additional
+check is made that more than `server.headersTimeout` milliseconds has not
+passed since the connection was established. If the check fails, a `'timeout'`
+event is emitted on the server object, and (by default) the socket is destroyed.
+See [server.timeout][] for more information on how timeout behaviour can be
+customised.
+
### server.setTimeout([msecs][, callback])
<!-- YAML
added: v0.9.12
diff --git a/doc/api/https.md b/doc/api/https.md
index ee023810f80..f6c0da5cbb0 100644
--- a/doc/api/https.md
+++ b/doc/api/https.md
@@ -36,6 +36,12 @@ See [`server.close()`][`http.close()`] from the HTTP module for details.
Starts the HTTPS server listening for encrypted connections.
This method is identical to [`server.listen()`][] from [`net.Server`][].
+### server.headersTimeout
+
+- {number} **Default:** `40000`
+
+See [`http.Server#headersTimeout`][].
+
### server.setTimeout([msecs][, callback])
<!-- YAML
added: v0.11.2
@@ -253,6 +259,7 @@ const req = https.request(options, (res) => {
[`URL`]: url.html#url_the_whatwg_url_api
[`http.Agent`]: http.html#http_class_http_agent
[`http.Server#keepAliveTimeout`]: http.html#http_server_keepalivetimeout
+[`http.Server#headersTimeout`]: http.html#http_server_headerstimeout
[`http.Server#setTimeout()`]: http.html#http_server_settimeout_msecs_callback
[`http.Server#timeout`]: http.html#http_server_timeout
[`http.Server`]: http.html#http_class_http_server