node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

reverser

Reverser

NPM version Build Status Dependency Status

A reverse proxy middleware for connect/express

Install

npm install reverser

Usage

var Reverser = require('reverser');
 
var reverser = new Reverser({});
 
reverser.register("/ajax/*", 'hostname:8080');
 
reverser.register("/post|get", 'hostname1');
 
// connect 
var app = require('connect')();
 
// or express 
var app = require('express')();
 
 
app.use(reverser.serve);
 
// or forward with shorted path 
app.use('/proxy', reverser.serve);
 

See routington for the register path syntax

License

(The MIT License)

Copyright (c) 2013, Villa.Gao <jky239@gmail.com>;
All rights reserved.