Răsfoiți Sursa

Add documentation for selector/urltest outbound

世界 3 ani în urmă
părinte
comite
e5e24ef51d

+ 2 - 0
docs/configuration/outbound/index.md

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

+ 35 - 0
docs/configuration/outbound/selector.md

@@ -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.

+ 41 - 0
docs/configuration/outbound/urltest.md

@@ -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.

+ 4 - 4
docs/index.md

@@ -18,10 +18,10 @@ Install with options:
 go install -v -tags "with_clash_api,no_gvisor" github.com/sagernet/sing-box/cmd/sing-box@latest
 ```
 
-| Build Tag        | Description                                                                             |
-|------------------|-----------------------------------------------------------------------------------------|
-| `with_clash_api` | Build with clash api support, see [Experimental](./configuration/experimental).         |
-| `no_gvisor`      | Build without gVisor, which required by the [Tun](./configuration/inbound/tun) inbound. |
+| Build Tag        | Description                                                                                      |
+|------------------|--------------------------------------------------------------------------------------------------|
+| `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.          |
 
 The binary is built under $GOPATH/bin
 

+ 2 - 0
mkdocs.yml

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