I'm using the Apache on port 80.
Node.js server listen on port 1337, Apache through him all proxied requests:
ProxyRequests off
ProxyPass /nodejs/ http://127.0.0.1:1337/ timeout=300 retry=0
ProxyPassReverse /nodejs/ http://127.0.0.1:1337/
And server.js:
var http = require("http");
http.createServer(function (req, res) {
req.socket.on("close", function () {
console.log("socket close");
});
}).listen(1337);
Problem: When the connection aborted by the user (stop request in browser, for example pressing Esc), node.js can't fire socket.on("close") till apache's timeout is alive.
What are the solutions to the problem, other than put Apache behind node.js?