I am trying to disable a parameter keep-alivein a very simple application express. I tried the answer from someone who does the same in the old version :
var express = require('express');
var app = express();
app.get('/', function(req, res) {
res.set('Connection', 'close');
res.set('Proof', 'close');
res.send('hello');
});
var server = app.listen(3000, function() {
console.log('Listening on port %d', server.address().port);
});
However Connection, still set to keep-alive:
$ curl -D - http://my-test-site.com
HTTP/1.1 200 OK
Server: nginx/1.4.7
Date: Sun, 11 May 2014 08:07:51 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 5
Connection: keep-alive
X-Powered-By: Express
Proof: close
ETag: "907060870"
hello%
How can i change keep-aliveto close?
Version
node 0.10.8
express 4.1.1
source
share