mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
updated readme
This commit is contained in:
parent
76d0649abc
commit
fb8c5abd3c
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user