Last active
August 23, 2016 02:48
-
-
Save mrajagopal/fef60bf8dc6e053e148a to your computer and use it in GitHub Desktop.
LineRate's Node.js script to modify the HTTP response header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var vsm = require('lrs/virtualServerModule'); | |
var requestHandler = function(servReq, servResp, next){ | |
servReq.on('response', function responseHandler(cliResp){ | |
cliResp.bindHeaders(servResp); | |
servResp.removeHeader("Server"); | |
servResp.removeHeader("X-Powered-By"); | |
servResp.setHeader("Via", "1.1 LineRate"); | |
cliResp.pipe(servResp); | |
}); | |
next(); | |
} | |
vsm.on('exist', 'myVirtualServer', function(vs) { | |
console.log('myVirtualServer started'); | |
vs.on('request', requestHandler); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment