1
0
mirror of https://github.com/nitezs/sub2sing-box.git synced 2024-12-24 13:04:41 -05:00
sub2sing-box/Readme.md

75 lines
1.3 KiB
Markdown
Raw Normal View History

2024-03-11 07:56:50 -04:00
# sub2sing-box
2024-03-12 04:56:20 -04:00
## Cli Command
### convert
2024-03-11 07:56:50 -04:00
```
2024-03-11 07:58:04 -04:00
Convert common proxy to sing-box proxy
2024-03-11 07:56:50 -04:00
Usage:
convert [flags]
Flags:
2024-03-11 12:15:35 -04:00
-d, --delete string delete proxy with regex
-h, --help help for convert
-o, --output string output file path
-p, --proxy strings common proxies
-r, --rename stringToString rename proxy with regex (default [])
-s, --subscription strings subscription urls
-t, --template string template file path
2024-03-11 11:39:58 -04:00
```
2024-03-12 04:56:20 -04:00
### server
2024-03-11 14:58:16 -04:00
```
Run the server
Usage:
server [flags]
Flags:
-h, --help help for server
-p, --port uint16 server port (default 8080)
```
2024-03-12 04:56:20 -04:00
#### api
##### GET /convert
- `data`: Base64 编码的 JSON 字符串,包含以下字段:
- `subscription`: []string
- `proxy`: []string
2024-03-12 14:02:17 -04:00
- `delete`: string 可选
- `rename`: string 可选
- `template`: map[string]string 可选
示例
```
{
"subscription": ["url1", "url2"],
"proxy": ["p1", "p2"],
"delete": "reg",
"template": "t",
"rename": {
"text": "replaceTo"
}
}
```
2024-03-12 04:56:20 -04:00
2024-03-11 11:39:58 -04:00
## Template
Template 中使用 `<all-proxy-tags>` 指明节点插入位置,例如
```
{
"type": "selector",
"tag": "节点选择",
"outbounds": ["<all-proxy-tags>", "direct"],
"interrupt_exist_connections": true
},
```
2024-03-12 14:02:17 -04:00
## Docker
`docker run -p 8080:8080 nite07/sub2sing-box`