-
-
Save matiasinsaurralde/6f4ec1e71cfc04c12a2dcbf5cace3431 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