remove_connection
v0.3.0
Published
remove Connection header from http(s) response
Downloads
3
Readme
remove_connection
Just a simple hack to remove Connection header from HTTP(S) response. Similar to remove_date
Installation
Install through NPM
npm install remove_connection
or
git clone git://github.com/hex7c0/remove_connection.git
API
inside nodejs project
var setConnection = require('remove_connection');
require('http').createServer(function(req, res) {
setConnection(res); // remove Connection header from response
res.writeHead(200, {
'Content-Type': 'text/plain'
});
res.end('Hello World\n');
}).listen(3000, '127.0.0.1');
as middleware
var setConnection = require('remove_connection').setConnectionMiddleware;
var app = require('express')();
app.use(setConnection()).get('/', function(req, res) {
res.end('Hello World\n');
}).listen(3000, '127.0.0.1');
setConnection(res [, setHeader])
options
res
- Object response to client (default "required")setHeader
- Boolean setHeader block (default "optional")
setConnectionMiddleware([setHeader])
options
setHeader
- Boolean setHeader block (default "optional")
Examples
Take a look at my examples