i add some logs:
var http = require('http');
var httpProxy = require('http-proxy');
var proxy = new httpProxy.RoutingProxy();
http.createServer(function(req, res) {
console.log("ready to proxy req to", req.headers['host']);
proxy.proxyRequest(req, res, {
host: req.headers['host'],
port: 80
});
}).listen(process.env.app_port || 8080);
console.log("proxy is running");
If run it locally, set the browser's proxy to localhost, and visit "
www.google.com", the log says:
proxy is running
ready to proxy req to www.google.com
ready to proxy req to www.google.com
ready to proxy req to www.google.com
If run it on Nodester, the log says:
nodester info Showing logs for: kapp
New PID: 7659
chroot_runner
chroot_runner
Spawing /app/test.js
Running node v-0.6.17
proxy is running
Then set the browser's proxy to Nodester, and visit "
www.google.com". Check logs again, the result is no new logs output, the app seems does not receive any request.
I know that Nodester setup an association between "
appname.nodester.com:80" and "the_actual_app_host:app_port", but it seems can not transparently route http requests?
Purpose: Because i can not visit some sites directly from my host, i just want setup a http proxy on Nodester to route http requests to these sites.
Or Nodester can not do this? Only web apps?
在 2012年6月20日星期三UTC+8下午11时38分16秒,Alejandro Morales Gámez写道: