From fb8c5abd3c2a722c1c18046dcf2fffea4fa7d050 Mon Sep 17 00:00:00 2001 From: Marak Squires Date: Mon, 2 Aug 2010 00:19:40 -0400 Subject: [PATCH] updated readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 774a6bf..6619ff6 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,14 @@ see the [demo](http://github.com/nodejitsu/node-http-proxy/blob/master/demo.js) var http = require('http'), httpProxy = require('http-proxy'); + + // create a proxy server with custom application logic httpProxy.createServer(function (req, res, proxy) { // Put your custom server logic here proxy.proxyRequest('localhost', '9000', req, res); }).listen(8000); + // create a regular http server and proxy its handler http.createServer(function (req, res){ var proxy = new httpProxy.HttpProxy; proxy.watch(req, res);