2022-08-24 08:23:21 +00:00
|
|
|
# 引言
|
|
|
|
|
2022-08-25 01:45:22 +00:00
|
|
|
sing-box 使用 JSON 作为配置文件格式。
|
2022-08-24 08:23:21 +00:00
|
|
|
|
|
|
|
### 结构
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"log": {},
|
|
|
|
"dns": {},
|
2022-08-31 05:21:29 +00:00
|
|
|
"inbounds": [],
|
|
|
|
"outbounds": [],
|
2022-08-24 08:23:21 +00:00
|
|
|
"route": {},
|
|
|
|
"experimental": {}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### 字段
|
|
|
|
|
2023-12-14 14:23:52 +00:00
|
|
|
| Key | Format |
|
|
|
|
|----------------|------------------------|
|
|
|
|
| `log` | [日志](./log/) |
|
|
|
|
| `dns` | [DNS](./dns/) |
|
|
|
|
| `inbounds` | [入站](./inbound/) |
|
|
|
|
| `outbounds` | [出站](./outbound/) |
|
|
|
|
| `route` | [路由](./route/) |
|
|
|
|
| `experimental` | [实验性](./experimental/) |
|
2022-08-24 08:23:21 +00:00
|
|
|
|
|
|
|
### 检查
|
|
|
|
|
|
|
|
```bash
|
2023-09-19 11:59:07 +00:00
|
|
|
sing-box check
|
2022-08-24 08:23:21 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### 格式化
|
|
|
|
|
|
|
|
```bash
|
2023-09-19 11:59:07 +00:00
|
|
|
sing-box format -w -c config.json -D config_directory
|
|
|
|
```
|
|
|
|
|
|
|
|
### 合并
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sing-box merge output.json -c config.json -D config_directory
|
2022-08-24 08:23:21 +00:00
|
|
|
```
|