I am trying to create a node-http-proxy server that explicitly sets the Date passed in all requests. Can anyone please advise me how to do this.
i.e. I want to force the date passed in all HTTP request(s) to be a date in the past
Setting the Date in the req.headers does not appear to work:
var http = require('http'),
httpProxy = require('http-proxy');
var proxy = httpProxy.createProxyServer({});
var server = http.createServer(function(req, res) {
console.log("Proxying: " + req.url);
req.headers["Date"] = "Fri, 18 Dec 2015 08:49:37 GMT";
//req.headers["date"] = "Fri, 18 Dec 2015 08:49:37 GMT";
proxy.web(req, res, { target: 'http://somewhereElse.com:9090' });
});
console.log("listening on port 8888")
server.listen(8888);