@calvin_von/plugin-request-hijack
v1.3.1
Published
A dalao-proxy plugin for hijacking asynchronous requests to do more cool things
Downloads
76
Maintainers
Readme
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
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.