From the nodejs perspective
server.timeout
Timeout in milliseconds. Default: 120000 (2 minutes).
The number of milliseconds of inactivity before a socket is presumed to have timed out.
A value of 0 will disable the timeout behavior on incoming connections.
The socket timeout logic is set up on connection, so changing this value only affects new connections to the server, not any existing connections.
To change the default timeout use the --http-server-default-timeout flag.
server.keepAliveTimeout
Timeout in milliseconds. Default: 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. 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.
In other words:
server.timeout can inform the client how long the server is willing to keep the connection
server.keepAliveTimeout resets the server.timeout when it receive data before the keep-alive timeout has fired
I realized later @Software Person also told the same thing in another way, right!