0
這是我寫的一個小型代理程序,用於測試某些情況。來自http代理的statusCode不正確
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");
這款採用
"http-proxy": "0.8.x"
"connect": "2.3.x"
當我運行這個程序和訪問它時,的StatusCode爲200到目標URL不存在。任何幫助非常感謝。這是在延續與How to catch 404 errors using connect framework