@@ -65,37 +65,28 @@ see the [demo](http://github.com/nodejitsu/node-http-proxy/blob/master/demo.js)
</pre>
### How to proxy requests with a regular http server
<pre>
var http = require('http'),
httpProxy = require('http-proxy');
### How to proxy requests with latent operations (IO, etc.)
// create a regular http server and proxy its handler
http.createServer(function (req, res){
var proxy = new httpProxy.HttpProxy;
proxy.watch(req, res);
// Put your custom server logic here
proxy.proxyRequest(9000, 'localhost', req, res);
}).listen(8001);
node-http-proxy supports event buffering, that means if an event (like 'data', or 'end') is raised by the incoming request before you have a chance to perform your custom server logic, those events will be captured and re-raised when you later proxy the request. Here's a simple example:
### Why doesn't node-http-proxy have more advanced features like x, y, or z?
If you have a suggestion for a feature currently not supported, feel free to open a [support issue](http://github.com/nodejitsu/node-http-proxy/issues). node-http-proxy is designed to just proxy http requests from one server to another, but we will be soon releasing many other complimentary projects that can be used in conjunction with node-http-proxy.
<br/><hr/>
<br/>
### License
(The MIT License)
Copyright (c) 2010 Charlie Robbins & Marak Squires http://github.com/nodejitsu/
Copyright (c) 2010 Mikeal Rogers, Charlie Robbins & Marak Squires
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
...
...
@@ -116,4 +107,4 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.