Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I use node.js http-proxy for logging htttp traffic in a computer?
  2. var http = require('http'),
  3. var httpProxy = require('http-proxy');
  4.  
  5. httpProxy.createServer(function (req, res, proxy) {
  6.     //
  7.     // I would add logging here
  8.     //
  9.     proxy.proxyRequest(req, res, { host: 'www.google.com', port: 80 });
  10. }).listen(18000);