node-http-proxy
node-http-proxy copied to clipboard
Forward proxy fails for some sites.
This works for some sites but for others, it does not. Basically, some of the URLs in the HTML pages give a 404 not found error when visited through the proxy but work fine otherwise. What am I missing here?
var httpApp = require('express')(),
http = require('http'),
httpProxy = require('http-proxy');
httpServer = http.createServer(httpApp);
proxy = httpProxy.createProxyServer({xfwd:true,ws:true});
httpApp.use(function(req,res) {
proxy.web(req,res, {xfwd: true, ws:true, target:req.originalUrl }, function(err){console.log(err);});
});
httpServer.listen(5000);
Example, cnbc.com. Works fine, click on any link and its a 404 not found. Why?
xfwd does not add the X-Forwarded-Host header (https://github.com/nodejitsu/node-http-proxy/issues/886)
Could that be the issue?