Matias Alejo Garcia
8 years ago
No known key found for this signature in database
GPG Key ID: 2470DB551277AB3
2 changed files with
11 additions and
1 deletions
-
bws.js
-
lib/expressapp.js
|
|
@ -51,7 +51,7 @@ function startInstance(cb) { |
|
|
|
var server = config.https ? serverModule.createServer(serverOpts, expressApp.app) : serverModule.Server(expressApp.app); |
|
|
|
|
|
|
|
server.on('connection', function(socket) { |
|
|
|
socket.setTimeout(300 * 1000); |
|
|
|
socket.setTimeout(2 * 1000); |
|
|
|
}) |
|
|
|
|
|
|
|
expressApp.start(config, function(err) { |
|
|
|
|
|
@ -54,6 +54,16 @@ ExpressApp.prototype.start = function(opts, cb) { |
|
|
|
this.app.use(allowCORS); |
|
|
|
this.app.enable('trust proxy'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// handle `abort` https://nodejs.org/api/http.html#http_event_abort
|
|
|
|
this.app.use(function (req, res, next) { |
|
|
|
req.on('abort', function() { |
|
|
|
log.warn('Request aborted by the client'); |
|
|
|
}); |
|
|
|
next(); |
|
|
|
}); |
|
|
|
|
|
|
|
var POST_LIMIT = 1024 * 100 /* Max POST 100 kb */ ; |
|
|
|
|
|
|
|
this.app.use(bodyParser.json({ |
|
|
|