@calvin_von/plugin-request-hijack
v1.3.4
Published
A dalao-proxy plugin for hijacking asynchronous requests to do more cool things
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-proxyInstall plugin
globally
dalao-proxy plugin install -g @calvin_von/plugin-request-hijacklocally
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 startConfig
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
RegExpstring to match URLs - to: A string or
RegExpreplace string to rewrite URLs
more docs about dalao-proxy, see CalvinVon/dalao-proxy on Github.
