add: 国家策略组功能

This commit is contained in:
2024-03-19 21:02:53 +08:00
parent 3c180ae61e
commit 891db1975f
9 changed files with 655 additions and 131 deletions

View File

@@ -10,41 +10,53 @@
## api
##### GET /convert
### GET /convert?data=xxx
- `data`: Base64 编码(url safe)的 JSON 字符串,包含以下字段:
- `subscription`: []string
- `proxy`: []string
- `delete`: string 可选
- `rename`: string 可选
- `template`: map[string]string 可选
示例
data 为 base64 URL 编码的请求体,示例
```
{
"subscription": ["url1", "url2"],
"proxy": ["p1", "p2"],
"delete": "reg",
"template": "t",
"rename": {
"text": "replaceTo"
}
"subscriptions": ["订阅地址1", "订阅地址2"],
"proxies": ["代理1", "代理2"],
"template": "模板路径",
"delete": "",
"rename": {"原文本": "新文本"},
"group": false,
"group-type": "selector",
"sort": "name",
"sort-type": "asc"
}
```
## Template
## Template 占位符
Template 中使用 `<all-proxy-tags>` 指明节点插入位置,例如
```
{
"type": "selector",
"tag": "节点选择",
"outbounds": ["<all-proxy-tags>", "direct"],
"interrupt_exist_connections": true
},
```
- `<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
}
```
## Docker