server.headersTimeout


限制解析器等待接收完整 HTTP 标头的时间。

在不活动的情况下,server.timeout 中定义的规则适用。 但是,如果标头发送非常缓慢(默认情况下,每 2 分钟最多一个字节),基于不活动的超时仍然允许连接保持打开状态。 为了防止这种情况,每当标头数据到达时,都会进行额外的检查,以确保自连接建立以来没有超过 server.headersTimeout 毫秒。 如果检查失败,则会在服务器对象上触发 'timeout' 事件,并且(默认情况下)套接字将被销毁。 有关如何自定义超时行为的更多信息,请参阅 server.timeout

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 behavior can be customized.