Reputation: 95
I am developing an application backend based on node.js
server and express, the application is receiving an external flux from an apache
server that require a "keep alive " disabled
So I tried to disable the option buy req.setSocketKeepAlive(false);
var http = require('http');
var express = require('express');
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
var app = express();
var server = http.createServer(app);
server.keepAliveTimeout(0)
but it doesnt work.
Do you have any ideas how to solve this issue ?
Upvotes: 7
Views: 6044
Reputation: 348
Although not ideal, setting the Connection
header to close
in a middleware can help you.
Upvotes: 3