I assume you are using express , given the logs you have in your question. The key is to set the timeout property on the server (the following sets the timeout to one second, use whatever value you want):
var server = app.listen(app.get('port'), function() { debug('Express server listening on port ' + server.address().port); }); server.timeout = 1000;
If you do not use express and work only with vanilla node, the principle is the same. The following data is not returned:
var http = require('http'); var server = http.createServer(function (req, res) { setTimeout(function() { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }, 200); }).listen(1337, '127.0.0.1'); server.timeout = 20; console.log('Server running at http://127.0.0.1:1337/');
SomeKittens May 29 '14 at 6:19 a.m. 2014-05-29 06:19
source share