Im using Express 4.X and node js 0.12.
One of my routes is downloading and processing files, and for some files, downloading and the process takes more than 2 minutes by default. I tried to set the value for more than 2 minutes, but it just does not work, the server closes the connection exactly after 2 minutes each time.
server.timeout = 60 * 60 * 1000; // still closes after 2 minutes server.on('connection', function(socket) { socket.setTimeout(700 * 1000); // still closes after 2 minutes }); res.setTimeout(0);// still closes after 2 minutes req.setTimeout(0);// still closes after 2 minutes res.connection.setTimeout(0);// still closes after 2 minutes
Also, middleware for connection-timeout is not supported, it just closes the connection after exactly 2 minutes. Tried to change the node version to an older version, but without success. I tried all the options found on the Internet, but the connection still closes ...
source share