1
0
mirror of https://github.com/nitezs/sub2sing-box.git synced 2024-12-23 15:14:43 -05:00
sub2sing-box/README.md

66 lines
1.5 KiB
Markdown
Raw Normal View History

2024-03-19 01:55:31 -04:00
# sub2sing-box
2024-05-04 10:49:46 -04:00
## 控制台命令
2024-03-19 01:55:31 -04:00
2024-03-19 05:20:58 -04:00
- convert: 转换
- server: 启动 Web UI
- version: 版本信息
2024-03-19 01:55:31 -04:00
2024-03-19 05:20:58 -04:00
`sub2sing-box <command> -h` 查看帮助
2024-03-19 01:55:31 -04:00
2024-05-04 10:49:46 -04:00
## Api
2024-03-19 01:55:31 -04:00
2024-03-19 09:02:53 -04:00
### GET /convert?data=xxx
2024-03-19 01:55:31 -04:00
2024-05-04 10:49:46 -04:00
data 为 base64 URL 编码(将编码字符串中`/`替换为`_``+`替换为`-`)的 JSON 结构体,示例
2024-03-19 05:20:58 -04:00
2024-03-19 01:55:31 -04:00
```
{
2024-03-19 09:02:53 -04:00
"subscriptions": ["订阅地址1", "订阅地址2"],
"proxies": ["代理1", "代理2"],
2024-05-04 10:49:46 -04:00
"template": "模板路径/网络地址",
2024-03-19 09:02:53 -04:00
"delete": "",
"rename": {"原文本": "新文本"},
"group-type": "selector",
"sort": "name",
"sort-type": "asc"
2024-03-19 01:55:31 -04:00
}
```
2024-10-01 00:45:55 -04:00
该 JSON 同时可用于 `convert``--config` 参数,以便本地生成 sing-box 配置。
例如将上方 JSON 内容存放于 `config.json` 后执行 `sub2sing-box convert -c ./config.json` 即可生成 sing-box 配置,免去每次生成时重复设置参数
2024-03-19 09:02:53 -04:00
## Template 占位符
2024-03-19 01:55:31 -04:00
2024-03-19 09:02:53 -04:00
- `<all-proxy-tags>`: 插入所有节点标签
```
{
"type": "selector",
"tag": "节点选择",
"outbounds": ["<all-proxy-tags>", "direct"],
"interrupt_exist_connections": true
}
```
- `<all-country-tags>`: 插入所有国家标签
```
{
"type": "selector",
"tag": "节点选择",
"outbounds": ["<all-country-tags>", "direct"],
"interrupt_exist_connections": true
}
```
- `<国家(地区)二字码>`: 插入国家(地区)所有节点标签,例如 `<tw>`
```
{
"type": "selector",
"tag": "巴哈姆特",
"outbounds": ["<tw>", "direct"],
"interrupt_exist_connections": true
}
```
2024-03-19 01:55:31 -04:00
## Docker
2024-03-19 05:20:58 -04:00
`docker run -p 8080:8080 nite07/sub2sing-box`