Foxy
Proxy with response moddin'
cli
First, install globally
$ npm install -g foxy
Then, if you wanted to proxy a local vhost such as http://magento.dev
run:
$ foxy http://magento.dev
A random port will be used, but if you want to provide your own:
$ foxy http://magento.dev --port 3000
api
var foxy = ; var proxy = ; // Now access the site through http://localhost:8000
Built-in middleware will re-write html on the fly to update any urls & there'll also be the option for additional rules for the re-writing.
Additional re-write rules
Let's say you want to change the text Home Page
to be Homepage Rocks
, you can do that easily by
providing additional rules
var foxy = ; var config = rules: match: /Home Page/g { return "Homepage Rocks" } ; var proxy = ;
white/black lists
You can force some paths to always be processed by the middlewares.
var proxy = ;
proxyResponse middleware
You can add middleware-like functions which process the proxy response.
var foxy = ; var config = proxyRes: { // do something with the proxyRes object which comes from node-http-proxy } ; var proxy = ;
TODO
- https