whistle.try
v1.0.0
Published
Provide fallback functionality for local rules of whistle
Downloads
1
Readme
whistle.try
Provide fallback functionality for local rules of whistle
Installation
npm install -g whistle.try
Usage
Add try://
in front of your local rules:
- example.com https://localhost:8000
+ example.com try://https://localhost:8000
The rule will automatically change to a transparent proxy when the corresponding local service is not started.
For automatic protocols, you can use any of the following forms:
example.com try:////localhost:8000
# or
example.com try://localhost:8000
When using interpolation, you may need to adjust the position of the interpolation:
- example.com https://`localhost:8000${path}`
+ example.com try://`https://localhost:8000${path}`
How it works
This plugin will check the service status through HEAD requests before proxying real requests. Therefore, it only works for HTTP/HTTPS requests.
Avoid using this plugin rule for non-local proxies as it may introduce a large overhead.