foxy
Proxy with response modding
Last updated 11 years ago by shakyshane .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install foxy 
SYNC missed versions from official npm registry.

##Foxy Travis branch AppVeyor branch

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 = require("foxy");

var proxy = foxy("http://localhost:3000").listen(8000);

// 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 = require("foxy");

var config = {
    rules: [
        {
            match: /Home Page/g,
            fn: function () {
                return "Homepage Rocks"
            }
        }
    ]
};

var proxy = foxy("http://localhost:3000", config).listen(8000);

white/black lists

You can force some paths to always be processed by the middlewares.

var proxy = foxy("http://wordpress.dev", {
    whitelist: ["/wp-admin/admin-ajax.php"], // whitelist checked first
    blacklist: ["/wp-admin/**"],
}).listen(8000);

proxyResponse middleware

You can add middleware-like functions which process the proxy response.

var foxy = require("foxy");

var config = {
    proxyRes: [
        function(proxyRes, req, config) {
            // do something with the proxyRes object which comes from node-http-proxy
        }
    ]
};

var proxy = foxy("http://localhost:3000", config).listen(8000);

#TODO

  • [ ] https

Current Tags

  • 11.1.5                                ...           latest (10 years ago)

52 Versions

  • 11.1.5                                ...           10 years ago
  • 11.1.4                                ...           10 years ago
  • 11.1.3                                ...           11 years ago
  • 11.1.2                                ...           11 years ago
  • 11.1.1                                ...           11 years ago
  • 11.1.0                                ...           11 years ago
  • 11.0.4                                ...           11 years ago
  • 11.0.3                                ...           11 years ago
  • 11.0.2                                ...           11 years ago
  • 11.0.1                                ...           11 years ago
  • 11.0.0                                ...           11 years ago
  • 10.1.2                                ...           11 years ago
  • 10.1.1                                ...           11 years ago
  • 10.1.0                                ...           11 years ago
  • 10.0.2                                ...           11 years ago
  • 10.0.1                                ...           11 years ago
  • 10.0.0                                ...           11 years ago
  • 9.0.0                                ...           11 years ago
  • 8.1.1                                ...           11 years ago
  • 8.1.0                                ...           11 years ago
  • 8.0.1                                ...           11 years ago
  • 8.0.0                                ...           11 years ago
  • 7.1.0                                ...           11 years ago
  • 7.0.3                                ...           11 years ago
  • 7.0.2                                ...           11 years ago
  • 7.0.1                                ...           11 years ago
  • 7.0.0                                ...           11 years ago
  • 7.0.0-rc3                                ...           11 years ago
  • 7.0.0-rc2                                ...           11 years ago
  • 7.0.0-rc1                                ...           11 years ago
  • 6.1.0                                ...           11 years ago
  • 6.0.0                                ...           11 years ago
  • 5.0.1                                ...           11 years ago
  • 5.0.0                                ...           11 years ago
  • 4.0.3                                ...           11 years ago
  • 4.0.2                                ...           11 years ago
  • 4.0.1                                ...           11 years ago
  • 4.0.0                                ...           11 years ago
  • 3.1.0                                ...           11 years ago
  • 3.0.0                                ...           11 years ago
  • 2.0.2                                ...           12 years ago
  • 2.0.1                                ...           12 years ago
  • 2.0.0                                ...           12 years ago
  • 0.2.1                                ...           12 years ago
  • 0.2.0                                ...           12 years ago
  • 0.1.5                                ...           12 years ago
  • 0.1.4                                ...           12 years ago
  • 0.1.3                                ...           12 years ago
  • 0.1.2                                ...           12 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
  • 0.0.1                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 47
Last Day 0
Last Week 47
Last Month 1
Dependencies (8)
Dev Dependencies (19)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |