I am trying to implement the simplest example:
var http = require('http'),
var httpProxy = require('http-proxy');
httpProxy.createServer(function (req, res, proxy) {
//
// I would add logging here
//
proxy.proxyRequest(req, res, { host: 'www.google.com', port: 80 });
}).listen(18000);
When I configure my browser to use this proxy and I navigate to www.google.com I receive no response. What is that I am doing wrong?
I'm using Windows 7 Chrome
I am not sure if this helps because the posted information are really short. But I found a post that they updated the api ...
you might want to check out this post:
Updating to node-http-proxy v0.5.0 http://blog.nodejitsu.com/updating-node-http-proxy
Here is an simple example how to log requests. I use a similar to log all my domains to one database.
I copied much from http://blog.nodejitsu.com/http-proxy-middlewares