mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-23 09:01:30 +00:00
47 lines
815 B
Markdown
47 lines
815 B
Markdown
|
---
|
||
|
icon: material/new-box
|
||
|
---
|
||
|
|
||
|
# 源文件格式
|
||
|
|
||
|
!!! quote "sing-box 1.11.0 中的更改"
|
||
|
|
||
|
:material-plus: version `3`
|
||
|
|
||
|
!!! quote "sing-box 1.10.0 中的更改"
|
||
|
|
||
|
:material-plus: version `2`
|
||
|
|
||
|
!!! question "自 sing-box 1.8.0 起"
|
||
|
|
||
|
### 结构
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"version": 3,
|
||
|
"rules": []
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### 编译
|
||
|
|
||
|
使用 `sing-box rule-set compile [--output <file-name>.srs] <file-name>.json` 以编译源文件为二进制规则集。
|
||
|
|
||
|
### 字段
|
||
|
|
||
|
#### version
|
||
|
|
||
|
==必填==
|
||
|
|
||
|
规则集版本。
|
||
|
|
||
|
* 1: sing-box 1.8.0: 初始规则集版本。
|
||
|
* 2: sing-box 1.10.0: 优化了二进制规则集中 `domain_suffix` 规则的内存使用。
|
||
|
* 3: sing-box 1.11.0: 添加了 `network_type`、 `network_is_expensive` 和 `network_is_constrainted` 规则项。
|
||
|
|
||
|
#### rules
|
||
|
|
||
|
==必填==
|
||
|
|
||
|
一组 [无头规则](../headless-rule/).
|