https://github.com/cyansalt/whistle.try
Provide fallback functionality for local rules of whistle
https://github.com/cyansalt/whistle.try
Last synced: 7 months ago
JSON representation
Provide fallback functionality for local rules of whistle
- Host: GitHub
- URL: https://github.com/cyansalt/whistle.try
- Owner: CyanSalt
- License: isc
- Created: 2022-08-29T07:56:04.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T06:10:05.000Z (about 2 years ago)
- Last Synced: 2025-02-28T21:58:57.866Z (over 1 year ago)
- Language: JavaScript
- Size: 130 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# whistle.try
[](https://www.npmjs.com/package/whistle.try)
Provide fallback functionality for local rules of [whistle](https://github.com/avwo/whistle)
## Installation
```shell
npm install -g whistle.try
```
## Usage
Add `try://` in front of your local rules:
```diff
- 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:
```hosts
example.com try:////localhost:8000
# or
example.com try://localhost:8000
```
When using interpolation, you may need to adjust the position of the interpolation:
```diff
- 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.