...

订阅链接配置

了解如何添加、更新和管理 AiBooster 订阅,以及配置文件结构详解。


订阅链接配置

订阅是获取和更新节点的最便捷方式。本文介绍如何管理订阅以及配置文件的详细结构。

什么是订阅?

订阅是一个 URL 链接,包含:

  • 服务器节点信息
  • 自动更新功能
  • 流量使用统计

配置文件结构

AiBooster 使用 JSON 格式的配置文件。以下是完整的配置结构:

{
  "log": {},
  "dns": {},
  "ntp": {},
  "inbounds": [],
  "outbounds": [],
  "route": {},
  "experimental": {}
}

配置字段说明

字段类型必填说明
log对象日志配置,控制日志级别和输出
dns对象DNS 配置,用于域名解析
ntp对象NTP 配置,用于时间同步
inbounds数组入站配置,定义本地监听
outbounds数组出站配置,定义代理节点
route对象路由配置,定义分流规则
experimental对象实验性功能配置

日志配置 (log)

{
  "log": {
    "disabled": false,
    "level": "info",
    "output": "box.log",
    "timestamp": true
  }
}
字段类型默认值说明
disabled布尔false禁用日志输出
level字符串"info"日志级别:trace, debug, info, warn, error, fatal, panic
output字符串-日志输出文件路径
timestamp布尔true是否添加时间戳

DNS 配置 (dns)

{
  "dns": {
    "servers": [
      {
        "tag": "google",
        "address": "tls://8.8.8.8",
        "detour": "proxy"
      },
      {
        "tag": "local",
        "address": "223.5.5.5",
        "detour": "direct"
      }
    ],
    "rules": [
      {
        "domain_suffix": [".cn"],
        "server": "local"
      }
    ],
    "final": "google"
  }
}

入站配置 (inbounds)

入站定义了 AiBooster 在本地监听的端口和协议:

{
  "inbounds": [
    {
      "type": "mixed",
      "tag": "mixed-in",
      "listen": "127.0.0.1",
      "listen_port": 7890
    },
    {
      "type": "tun",
      "tag": "tun-in",
      "interface_name": "utun",
      "inet4_address": "172.19.0.1/30",
      "auto_route": true,
      "strict_route": true
    }
  ]
}

支持的入站类型:

  • mixed - HTTP/SOCKS5 混合代理
  • socks - SOCKS5 代理
  • http - HTTP 代理
  • tun - TUN 虚拟网卡(透明代理)
  • redirect - 透明代理重定向
  • tproxy - Linux 透明代理

出站配置 (outbounds)

出站定义了代理节点和直连规则:

{
  "outbounds": [
    {
      "type": "selector",
      "tag": "proxy",
      "outbounds": ["auto", "hk-node", "us-node"],
      "default": "auto"
    },
    {
      "type": "urltest",
      "tag": "auto",
      "outbounds": ["hk-node", "us-node"],
      "url": "https://www.gstatic.com/generate_204",
      "interval": "3m"
    },
    {
      "type": "shadowsocks",
      "tag": "hk-node",
      "server": "hk.example.com",
      "server_port": 443,
      "method": "aes-256-gcm",
      "password": "your-password"
    },
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "block",
      "tag": "block"
    },
    {
      "type": "dns",
      "tag": "dns-out"
    }
  ]
}

支持的出站类型:

  • direct - 直接连接
  • block - 阻止连接
  • dns - DNS 出站
  • selector - 手动选择节点
  • urltest - 自动测速选择
  • shadowsocks - Shadowsocks 协议
  • vmess - VMess 协议
  • trojan - Trojan 协议
  • hysteria - Hysteria 协议
  • hysteria2 - Hysteria2 协议
  • vless - VLESS 协议
  • wireguard - WireGuard 协议
  • ssh - SSH 协议
  • http - HTTP 代理
  • socks - SOCKS5 代理

路由配置 (route)

路由定义了流量分流规则:

{
  "route": {
    "rules": [
      {
        "protocol": "dns",
        "outbound": "dns-out"
      },
      {
        "geoip": ["private"],
        "outbound": "direct"
      },
      {
        "geosite": ["cn"],
        "outbound": "direct"
      },
      {
        "geosite": ["geolocation-!cn"],
        "outbound": "proxy"
      }
    ],
    "rule_set": [
      {
        "tag": "geoip-cn",
        "type": "remote",
        "format": "binary",
        "url": "https://example.com/geoip-cn.srs"
      }
    ],
    "final": "proxy",
    "auto_detect_interface": true
  }
}

路由匹配条件:

  • domain - 精确域名匹配
  • domain_suffix - 域名后缀匹配
  • domain_keyword - 域名关键词匹配
  • domain_regex - 域名正则匹配
  • geosite - GeoSite 规则集
  • geoip - GeoIP 规则集
  • ip_cidr - IP CIDR 匹配
  • port - 端口匹配
  • protocol - 协议匹配
  • network - 网络类型(tcp/udp)

实验性功能 (experimental)

{
  "experimental": {
    "cache_file": {
      "enabled": true,
      "path": "cache.db"
    },
    "clash_api": {
      "external_controller": "127.0.0.1:9090",
      "external_ui": "ui",
      "secret": ""
    }
  }
}

添加订阅

步骤

  1. 获取订阅链接(从服务提供商处)
  2. 打开 AiBooster
  3. 点击 "+""添加配置"
  4. 选择 "订阅链接"
  5. 填写信息:
    • 名称:自定义名称(如"工作订阅")
    • URL:粘贴订阅链接
  6. 点击 "保存"

订阅链接格式

https://example.com/api/v1/client/subscribe?token=xxxxxx

订阅链接包含你的账户信息,请勿分享给他人。

更新订阅

手动更新

  1. 进入 配置文件 页面
  2. 找到目标订阅
  3. 点击 刷新 图标
  4. 等待更新完成

自动更新

  1. 进入 设置订阅设置
  2. 开启 自动更新
  3. 设置更新间隔(推荐 24 小时)
更新间隔适用场景
1 小时节点频繁变化
6 小时一般使用
24 小时稳定服务商
手动按需更新

管理多个订阅

AiBooster 支持添加多个订阅:

切换订阅

  1. 进入 配置文件 页面
  2. 点击要使用的订阅
  3. 自动切换到该订阅的节点列表

删除订阅

  1. 长按或右键点击订阅
  2. 选择 删除
  3. 确认删除

编辑订阅

  1. 点击订阅右侧的 编辑 图标
  2. 修改名称或 URL
  3. 保存更改

订阅转换

如果订阅格式不兼容,可以使用订阅转换:

在线转换

  1. 访问订阅转换服务
  2. 输入原始订阅链接
  3. 选择输出格式(AiBooster JSON)
  4. 复制转换后的链接
  5. 在 AiBooster 中添加

内置转换

AiBooster 内置订阅转换器:

  1. 添加订阅时选择 高级选项
  2. 选择 订阅类型
    • 自动检测
    • AiBooster(JSON 格式)
    • Clash
    • V2ray
    • Shadowsocks

查看订阅信息

点击订阅可查看:

  • 节点数量:可用服务器数
  • 已用流量:本周期已使用
  • 剩余流量:本周期剩余
  • 到期时间:订阅有效期
  • 上次更新:最近更新时间

常见问题

更新失败

  1. 检查网络连接
  2. 确认订阅链接正确
  3. 尝试使用代理更新
  4. 联系服务提供商

节点列表为空

  1. 手动更新订阅
  2. 检查订阅是否过期
  3. 确认订阅格式兼容

流量信息不显示

部分订阅可能不提供流量统计,这是正常现象。

建议定期更新订阅以获取最新节点。