This is a small proxy program I wrote to test some case.
var httpProxy = require('http-proxy'),
connect = require('connect'),
endpoint = {
host: 'googleeeeeee.com', // or IP address
port: 80,
},
staticDir = 'public';
var proxy = new httpProxy.RoutingProxy();
var app = connect()
.use(connect.logger('dev'))
.use(function(req, res) {
proxy.proxyRequest(req, res, endpoint);
console.log("Respose is " + res.statusCode);
})
.use(connect.static(staticDir))
.listen(80);
console.log("Server started");
this uses
"http-proxy": "0.8.x"
"connect": "2.3.x"
When I run this program and access it, the statusCode is 200 through the target URL does not exist. Any help much appreciated. This is in continuation with How to catch 404 errors using connect framework