server.keepAliveTimeout


  • <number> 超时(毫秒)。默认值: 5000(5 秒)。

服务器在完成最后一次响应写入后,需要等待多少毫秒的空闲时间来接收额外的传入数据,然后套接字才会被销毁。如果服务器在保持活动超时触发之前接收到新数据,它将重置常规空闲超时,即 server.timeout

🌐 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.

将值设置为 0 会禁用对传入连接的 keep-alive 超时行为。 将值设置为 0 会使 HTTP 服务器的行为类似于 8.0.0 之前的 Node.js 版本,这些版本没有 keep-alive 超时。

🌐 A value of 0 will disable the keep-alive timeout behavior on incoming connections. A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.

套接字超时逻辑是在连接时设置的,因此更改此值只会影响与服务器的新连接,而不会影响任何现有连接。

🌐 The socket timeout logic is set up on connection, so changing this value only affects new connections to the server, not any existing connections.