2024-06-25 16:43:51 +00:00
|
|
|
---
|
|
|
|
icon: material/new-box
|
|
|
|
---
|
|
|
|
|
|
|
|
!!! quote "Changes in sing-box 1.10.0"
|
|
|
|
|
|
|
|
:material-plus: `type: inline`
|
|
|
|
|
2024-06-25 16:45:10 +00:00
|
|
|
# rule-set
|
2023-12-01 05:24:18 +00:00
|
|
|
|
|
|
|
!!! question "Since sing-box 1.8.0"
|
|
|
|
|
|
|
|
### Structure
|
|
|
|
|
2024-06-25 16:43:51 +00:00
|
|
|
=== "Inline"
|
|
|
|
|
|
|
|
!!! question "Since sing-box 1.10.0"
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"type": "inline", // optional
|
|
|
|
"tag": "",
|
|
|
|
"rules": []
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
=== "Local File"
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"type": "local",
|
|
|
|
"tag": "",
|
|
|
|
"format": "source", // or binary
|
|
|
|
"path": ""
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
=== "Remote File"
|
|
|
|
|
|
|
|
!!! info ""
|
|
|
|
|
|
|
|
Remote rule-set will be cached if `experimental.cache_file.enabled`.
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"type": "remote",
|
|
|
|
"tag": "",
|
|
|
|
"format": "source", // or binary
|
|
|
|
"url": "",
|
|
|
|
"download_detour": "", // optional
|
|
|
|
"update_interval": "" // optional
|
|
|
|
}
|
|
|
|
```
|
2023-12-01 05:24:18 +00:00
|
|
|
|
|
|
|
### Fields
|
|
|
|
|
|
|
|
#### type
|
|
|
|
|
|
|
|
==Required==
|
|
|
|
|
2024-06-25 16:45:10 +00:00
|
|
|
Type of rule-set, `local` or `remote`.
|
2023-12-01 05:24:18 +00:00
|
|
|
|
|
|
|
#### tag
|
|
|
|
|
|
|
|
==Required==
|
|
|
|
|
2024-06-25 16:45:10 +00:00
|
|
|
Tag of rule-set.
|
2023-12-01 05:24:18 +00:00
|
|
|
|
2024-06-25 16:43:51 +00:00
|
|
|
### Inline Fields
|
|
|
|
|
|
|
|
!!! question "Since sing-box 1.10.0"
|
|
|
|
|
|
|
|
#### rules
|
|
|
|
|
|
|
|
==Required==
|
|
|
|
|
2024-11-11 08:30:25 +00:00
|
|
|
List of [Headless Rule](../headless-rule/).
|
2024-06-25 16:43:51 +00:00
|
|
|
|
|
|
|
### Local or Remote Fields
|
|
|
|
|
2023-12-01 05:24:18 +00:00
|
|
|
#### format
|
|
|
|
|
|
|
|
==Required==
|
|
|
|
|
2024-06-25 16:43:51 +00:00
|
|
|
Format of rule-set file, `source` or `binary`.
|
2023-12-01 05:24:18 +00:00
|
|
|
|
|
|
|
### Local Fields
|
|
|
|
|
|
|
|
#### path
|
|
|
|
|
|
|
|
==Required==
|
|
|
|
|
2024-06-25 16:43:51 +00:00
|
|
|
!!! note ""
|
|
|
|
|
|
|
|
Will be automatically reloaded if file modified since sing-box 1.10.0.
|
|
|
|
|
2024-06-25 16:45:10 +00:00
|
|
|
File path of rule-set.
|
2023-12-01 05:24:18 +00:00
|
|
|
|
|
|
|
### Remote Fields
|
|
|
|
|
|
|
|
#### url
|
|
|
|
|
|
|
|
==Required==
|
|
|
|
|
2024-06-25 16:45:10 +00:00
|
|
|
Download URL of rule-set.
|
2023-12-01 05:24:18 +00:00
|
|
|
|
|
|
|
#### download_detour
|
|
|
|
|
|
|
|
Tag of the outbound to download rule-set.
|
|
|
|
|
|
|
|
Default outbound will be used if empty.
|
|
|
|
|
|
|
|
#### update_interval
|
|
|
|
|
2024-06-25 16:45:10 +00:00
|
|
|
Update interval of rule-set.
|
2023-12-01 05:24:18 +00:00
|
|
|
|
|
|
|
`1d` will be used if empty.
|