1
0
mirror of https://github.com/nitezs/sub2sing-box.git synced 2024-12-23 15:14:43 -05:00
将节点和订阅转换为 sing-box 配置
Go to file
2024-03-19 22:45:59 +08:00
.github/workflows update: goreleaser 2024-03-19 22:45:59 +08:00
.vscode add: template 2024-03-11 19:50:21 +08:00
api add: 国家策略组功能 2024-03-19 21:02:53 +08:00
cmd add: 国家策略组功能 2024-03-19 21:02:53 +08:00
internal add: 国家策略组功能 2024-03-19 21:02:53 +08:00
pkg add: 国家策略组功能 2024-03-19 21:02:53 +08:00
templates add: 国家策略组功能 2024-03-19 21:02:53 +08:00
.gitignore add: goreleaser 2024-03-12 02:24:23 +08:00
.goreleaser.pre.yaml update: goreleaser 2024-03-19 22:45:59 +08:00
.goreleaser.yaml update: goreleaser 2024-03-19 22:45:59 +08:00
docker-compose.yaml fix: docker 2024-03-19 02:54:03 +08:00
Dockerfile fix: docker 2024-03-19 02:54:03 +08:00
entrypoint.sh fix: docker 2024-03-19 02:54:03 +08:00
go.mod feat: api server 2024-03-12 01:34:08 +08:00
go.sum feat: api server 2024-03-12 01:34:08 +08:00
LICENSE fix: docker 2024-03-19 02:54:03 +08:00
main.go add: version cmd 2024-03-13 01:21:37 +08:00
README.md add: 国家策略组功能 2024-03-19 21:02:53 +08:00

sub2sing-box

cli

  • convert: 转换
  • server: 启动 Web UI
  • version: 版本信息

sub2sing-box <command> -h 查看帮助

api

GET /convert?data=xxx

data 为 base64 URL 编码的请求体,示例

{
  "subscriptions": ["订阅地址1", "订阅地址2"],
  "proxies": ["代理1", "代理2"],
  "template": "模板路径",
  "delete": "",
  "rename": {"原文本": "新文本"},
  "group": false,
  "group-type": "selector",
  "sort": "name",
  "sort-type": "asc"
}

Template 占位符

  • <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

docker run -p 8080:8080 nite07/sub2sing-box