1
0
mirror of https://github.com/nitezs/sub2sing-box.git synced 2024-12-23 15:24:42 -05:00
将节点和订阅转换为 sing-box 配置
Go to file
2024-03-19 17:20:58 +08:00
.github/workflows update: github workflow 2024-03-19 17:13:04 +08:00
.vscode add: template 2024-03-11 19:50:21 +08:00
api update: template可以接受网络文件 2024-03-19 17:01:53 +08:00
cmd add: version cmd 2024-03-13 01:21:37 +08:00
internal update: template可以接受网络文件 2024-03-19 17:01:53 +08:00
pkg update: template可以接受网络文件 2024-03-19 17:01:53 +08:00
templates fix: docker 2024-03-19 02:54:03 +08:00
.gitignore add: goreleaser 2024-03-12 02:24:23 +08:00
.goreleaser.yaml fix: docker 2024-03-19 02:54:03 +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 update: README 2024-03-19 17:20:58 +08:00

sub2sing-box

cli

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

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

api

GET /convert
  • data: Base64 编码(url safe)的 JSON 字符串,包含以下字段:
    • subscription: []string
    • proxy: []string
    • delete: string 可选
    • rename: string 可选
    • template: map[string]string 可选

示例

{
  "subscription": ["url1", "url2"],
  "proxy": ["p1", "p2"],
  "delete": "reg",
  "template": "t",
  "rename": {
    "text": "replaceTo"
  }
}

Template

Template 中使用 <all-proxy-tags> 指明节点插入位置,例如

{
  "type": "selector",
  "tag": "节点选择",
  "outbounds": ["<all-proxy-tags>", "direct"],
  "interrupt_exist_connections": true
},

Docker

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