foxy

Proxy with response modding

MIT 52 个版本
安装
npm install foxy
yarn add foxy
pnpm add foxy
bun add foxy
README

##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
版本列表
11.1.5 2016-03-22
11.1.4 2015-11-28
11.1.3 2015-08-06
11.1.2 2015-08-04
11.1.1 2015-07-18
11.1.0 2015-07-18
11.0.4 2015-06-25
11.0.3 2015-06-17
11.0.2 2015-06-11
11.0.1 2015-06-11
11.0.0 2015-05-22
10.1.2 2015-05-03
10.1.1 2015-03-31
10.1.0 2015-03-29
10.0.2 2015-02-12
10.0.1 2015-02-11
10.0.0 2015-02-11
9.0.0 2015-02-03
8.1.1 2015-01-27
8.1.0 2015-01-27
8.0.1 2015-01-27
8.0.0 2015-01-27
7.1.0 2015-01-13
7.0.3 2015-01-07
7.0.2 2015-01-03
7.0.1 2014-12-19
7.0.0 2014-12-15
7.0.0-rc3 2014-12-14
7.0.0-rc2 2014-12-14
7.0.0-rc1 2014-12-14
6.1.0 2014-12-13
6.0.0 2014-11-27
5.0.1 2014-11-16
5.0.0 2014-11-16
4.0.3 2014-11-08
4.0.2 2014-11-08
4.0.1 2014-11-08
4.0.0 2014-11-08
3.1.0 2014-11-02
3.0.0 2014-10-24
2.0.2 2014-10-08
2.0.1 2014-10-08
2.0.0 2014-09-29
0.2.1 2014-07-18
0.2.0 2014-06-27
0.1.5 2014-06-25
0.1.4 2014-06-22
0.1.3 2014-06-22
0.1.2 2014-06-19
0.1.1 2014-05-18
0.1.0 2014-05-18
0.0.1 2014-05-14