node-http-proxy
node-http-proxy copied to clipboard
Lot of TCP retransmits generated when proxying WebSockets. due to KeepAlive settings?
Hi,
Last couple of days I've been trying to implement (with node-http-proxy) a proxy for a simple chat app with http and websocket.
I noticed a lot of TCP retransmits packets generated by the proxy server.
I've searched in the code and it seems that there is a problem with the setKeepAlive call in lib/http-proxy/common.js
common.setupSocket = function(socket) {
socket.setTimeout(0);
socket.setNoDelay(true);
// line below actually ENABLEs KeepAlive with a 0 MS delay !!!
socket.setKeepAlive(true, 0); // <---
return socket;
};
The current line is enabling keepalive with zero millisecond delay which can be disastrous regarding performance.
I've commented setKeepAlive line and I have no more TCP reteransmits..
Is there a reason for setting TCP keepalive to 0 ms delay ?
It may be better to leave this setting to default value (ie: setKeepAlive(false,0) ) ?
Best
Hi,
I have the same problem on Windows 7 Ultimate Service Pack 1
under Linux and Windows 10 no problem !!!
Best
Hey, is this problem solved? My website is running on windows server 2016 and I am experiencing the same problem.
+1