I want to completely disable Keep-Alive in Node.js server, but setKeepAlive(false)
does not have any effect. This is sample code:
var http = require('http')
var server = http.createServer(function(req, res) {
res.end('Hello Node.js Server!')
})
server.on('connection', function(socket) {
socket.setKeepAlive(false)
})
server.listen(8080)
As you can see, after opening http://127.0.0.1:8080, keep-alive header is present:
Am I doing something wrong?
Info: I am running node v10.1.0, but it also does not work on v8.11.2.