Files
sing-box-extended-mirror/docs/configuration/rule-set/index.md
T

156 lines
2.9 KiB
Markdown
Raw Normal View History

!!! quote "Changes in sing-box 1.14.0"
:material-plus: [http_client](#http_client)
2026-07-16 18:57:55 +08:00
:material-delete-clock: [download_detour](#download_detour)
:material-alert: [tag](#tag)
!!! quote "Changes in sing-box 1.10.0"
:material-plus: `type: inline`
2024-06-26 00:45:10 +08:00
# rule-set
2023-12-01 13:24:18 +08:00
!!! question "Since sing-box 1.8.0"
### Structure
=== "Inline"
!!! question "Since sing-box 1.10.0"
```json
{
"type": "inline", // optional
"tag": "",
"rules": []
}
```
=== "Local File"
```json
{
"type": "local",
2026-07-16 18:57:55 +08:00
"tag": "", // or []
"format": "source", // or binary
"path": ""
}
```
=== "Remote File"
!!! info ""
Remote rule-set will be cached if `experimental.cache_file.enabled`.
```json
{
"type": "remote",
2026-07-16 18:57:55 +08:00
"tag": "", // or []
"format": "source", // or binary
"url": "",
"http_client": "", // or {}
"update_interval": "",
// Deprecated
"download_detour": ""
}
```
2023-12-01 13:24:18 +08:00
### Fields
#### type
==Required==
2024-06-26 00:45:10 +08:00
Type of rule-set, `local` or `remote`.
2023-12-01 13:24:18 +08:00
#### tag
==Required==
2024-06-26 00:45:10 +08:00
Tag of rule-set.
2023-12-01 13:24:18 +08:00
2026-07-16 18:57:55 +08:00
!!! question "Since sing-box 1.14.0"
`tag` also accepts a list of tags to define multiple rule-sets sharing other options at once.
The `{tag}` placeholder in `path` or `url` is replaced by each tag,
and is required when multiple tags are set.
Multiple tags conflict with `type: inline`.
### Inline Fields
!!! question "Since sing-box 1.10.0"
#### rules
==Required==
2025-02-10 14:33:41 +08:00
List of [Headless Rule](./headless-rule/).
### Local or Remote Fields
2023-12-01 13:24:18 +08:00
#### format
==Required==
Format of rule-set file, `source` or `binary`.
2023-12-01 13:24:18 +08:00
2025-05-01 11:00:01 +08:00
Optional when `path` or `url` uses `json` or `srs` as extension.
2023-12-01 13:24:18 +08:00
### Local Fields
#### path
==Required==
!!! note ""
Will be automatically reloaded if file modified since sing-box 1.10.0.
2024-06-26 00:45:10 +08:00
File path of rule-set.
2023-12-01 13:24:18 +08:00
### Remote Fields
#### url
==Required==
2024-06-26 00:45:10 +08:00
Download URL of rule-set.
2023-12-01 13:24:18 +08:00
#### http_client
2023-12-01 13:24:18 +08:00
!!! question "Since sing-box 1.14.0"
HTTP Client for downloading rule-set.
2023-12-01 13:24:18 +08:00
See [HTTP Client Fields](/configuration/shared/http-client/) for details.
2026-06-13 23:00:53 +08:00
When empty, the default HTTP client is used: the one named by
[`default_http_client`](/configuration/route/#default_http_client), or the first top-level
`http_clients` entry when `default_http_client` is empty.
!!! failure "Implicit default deprecated in sing-box 1.14.0"
When neither `http_clients` nor `default_http_client` is configured, an implicit HTTP
client connecting through the default outbound is used. This implicit default is
deprecated in sing-box 1.14.0 and will be removed in sing-box 1.16.0; define
`http_clients` instead.
2023-12-01 13:24:18 +08:00
#### update_interval
2024-06-26 00:45:10 +08:00
Update interval of rule-set.
2023-12-01 13:24:18 +08:00
`1d` will be used if empty.
#### download_detour
!!! failure "Deprecated in sing-box 1.14.0"
`download_detour` is deprecated in sing-box 1.14.0 and will be removed in sing-box 1.16.0, use `http_client` instead.
Tag of the outbound to download rule-set.