问题:
Is there any difference between keepAliveTimeout and connection timeout ? I am using node.js with express. I have specified timeout as follows:
const app = express();
app...
可以将文章内容翻译成中文,广告屏蔽插件会导致该功能失效:
问题:
Is there any difference between keepAliveTimeout and connection timeout ? I am using node.js with express. I have specified timeout as follows:
const app = express();
app.listen(3000, '0.0.0.0', () => {
console.log(`The server is running at http://localhost:3000/`);
});
app.on('connection', (socket) => {
socket.setTimeout(60 * 1000);
});
Will above code change keepAliveTimeout ? In browser I am getting just Connection: keep-alive
header in browser. How can I check keepAliveTimeout of my application ?
回答1:
Keep-Alive header can inform the client how long the server is willing to keep the connection open (timeout=N value) and how many requests you can do over the same connection (max=M) before the server will force a close of the connection.
Connection-TimeOut is when you request for connect and that takes mintue and don't get response so it give you Connection-TimeOut