Add documentation for selector/urltest outbound

This commit is contained in:
世界 2022-07-22 14:07:27 +08:00
parent c4e46c35b5
commit e5e24ef51d
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
5 changed files with 84 additions and 4 deletions

View file

@ -20,6 +20,8 @@
| `socks` | [Socks](./socks) | | `socks` | [Socks](./socks) |
| `http` | [HTTP](./http) | | `http` | [HTTP](./http) |
| `shadowsocks` | [Shadowsocks](./shadowsocks) | | `shadowsocks` | [Shadowsocks](./shadowsocks) |
| `selector` | [Selector](./selector) |
| `urltest` | [URLTest](./urltest) |
#### tag #### tag

View file

@ -0,0 +1,35 @@
### Structure
```json
{
"outbounds": [
{
"type": "selector",
"tag": "select",
"outbounds": [
"proxy-a",
"proxy-b",
"proxy-c"
],
"default": "proxy-c"
}
]
}
```
!!! error ""
The selector can only be controlled through the [Clash API](/configuration/experimental#clash-api-fields) currently.
### Fields
#### outbounds
==Required==
List of outbound tags to select.
#### default
The default outbound tag. The first outbound will be used if empty.

View file

@ -0,0 +1,41 @@
### Structure
```json
{
"outbounds": [
{
"type": "urltest",
"tag": "auto",
"outbounds": [
"proxy-a",
"proxy-b",
"proxy-c"
],
"url": "http://www.gstatic.com/generate_204",
"interval": "1m",
"tolerance": 50
}
]
}
```
### Fields
#### outbounds
==Required==
List of outbound tags to test.
#### url
The URL to test. `http://www.gstatic.com/generate_204` will be used if empty.
#### interval
The test interval. `1m` will be used if empty.
#### tolerance
The test tolerance in milliseconds. `50` will be used if empty.

View file

@ -19,8 +19,8 @@ go install -v -tags "with_clash_api,no_gvisor" github.com/sagernet/sing-box/cmd/
``` ```
| Build Tag | Description | | Build Tag | Description |
|------------------|-----------------------------------------------------------------------------------------| |------------------|--------------------------------------------------------------------------------------------------|
| `with_clash_api` | Build with clash api support, see [Experimental](./configuration/experimental). | | `with_clash_api` | Build with clash api support, see [Experimental](./configuration/experimental#clash-api-fields). |
| `no_gvisor` | Build without gVisor, which required by the [Tun](./configuration/inbound/tun) inbound. | | `no_gvisor` | Build without gVisor, which required by the [Tun](./configuration/inbound/tun) inbound. |
The binary is built under $GOPATH/bin The binary is built under $GOPATH/bin

View file

@ -56,6 +56,8 @@ nav:
- Socks: configuration/outbound/socks.md - Socks: configuration/outbound/socks.md
- HTTP: configuration/outbound/http.md - HTTP: configuration/outbound/http.md
- Shadowsocks: configuration/outbound/shadowsocks.md - Shadowsocks: configuration/outbound/shadowsocks.md
- Selector: configuration/outbound/selector.md
- URLTest: configuration/outbound/urltest.md
- Route: - Route:
- configuration/route/index.md - configuration/route/index.md
- GeoIP: configuration/route/geoip.md - GeoIP: configuration/route/geoip.md