1.3.0 • Published 11 months ago

@calvin_von/plugin-request-hijack v1.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

plugin-request-hijack

A dalao-proxy for hijacking asynchronous requests to do more cool things. Mostly rewrite requests url to local dalao-proxy server.

only support dalao-proxy > 1.x

version npm.io

Usage

Install dalao-proxy cli first

npm install -g dalao-proxy

Install plugin

  • globally

    dalao-proxy plugin install -g @calvin_von/plugin-request-hijack
  • locally

    dalao-proxy plugin install -D @calvin_von/plugin-request-hijack

Add config

"requestHijack": {
    "enable": true,
    "prefix": "",
    "smartInfer": true,
    "rewrite": [
        { "from": "...", "to": "...", }
    ]
}

Start proxy

$ dalao-proxy start
...
> npm run start

Config

prefix

Add prefix for all rewrite urls.

smartInfer

If rewrite not provided, smartInfer set to true will auto infer rewrite config from proxyTable of base config.

rewrite

  • from: A string or RegExp string to match URLs
  • to: A string or RegExp replace string to rewrite URLs

more docs about dalao-proxy, see CalvinVon/dalao-proxy on Github.

1.2.0

1 year ago

1.1.0

1 year ago

1.3.0

11 months ago

1.2.1

12 months ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.0-beta.2

3 years ago

1.0.0-beta.3

3 years ago

1.0.0-beta

4 years ago

1.0.0-beta.1

4 years ago

1.0.0-alpha

4 years ago