0

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?

  • Shorten timeout on Apache? Use nginx? Don't use any proxy at all? – freakish Feb 14 '13 at 09:54
  • Need a big timeout (otherwise, the meaning is lost long polling). No, but I looking for Apache's possible solutions. I really need a proxy (port 80 listen Apache). – user1162152 Feb 14 '13 at 10:09

0 Answers0