What is difference between keepAliveTimeout and connection timeout. How can I check keepAliveTimeout in headers?

问题: 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

  • 发表于 2019-03-29 12:59
  • 阅读 ( 193 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除