文章

生成带有自定义出站和规则的 sing-box 配置文件直链-geodata 方案

此方案适用于 sing-box,搭载 sing-boxp 内核,采用 `geosite` 和 `geoip` 规则搭配 geosite.db 和 geoip.db 路由规则文件

前言:

  1. 本教程可以生成扩展名为 .json 配置文件直链,可以一键导入使用了 sing-box PuerNya 版内核的客户端 如:ShellCrashsing-box for Android
  2. 生成的订阅链接地址不会改变,支持更新订阅,支持国内访问,支持同步机场节点
  3. 生成的订阅链接自带规则集,规则集来源 DustinWin/ruleset_geodata/geodata
  4. 本教程必须使用支持 outbound_providers 代理集合(即 Clash 订阅链接)的 sing-box PuerNya 版内核,请先确定自己机场的订阅链接是否为 Clash 订阅链接,若不是,需前往肥羊在线订阅转换工具进行转换,“生成类型”选择“Clash”,其它参数保持默认即可,转换后的订阅链接需要在末尾添加 &flag=clash,然后添加到 .json 文件 outbound_providers 代理集合的 download_url
  5. 推荐使用 Visual Studio Code 等专业编辑器来修改配置文件
  6. ShellCrash 支持本地导入配置文件,可以直接将下方的 .json 直链文件内容复制到 $CRASHDIR/jsons/config.json 文件中,可代替通过 ShellCrash 配置脚本 -> 6 -> 2 导入配置文件的方式

一、 准备编辑 .json 直链文件

1. 注册 Gist

进入 https://gist.github.com 网站并注册

2. 打开编辑页面

登录并打开 Gist 可以直接编辑文件,或者点击页面右上角头像左边的“+”图标新建文件

3. 输入描述和完整文件名

“Gist description…”输入描述,随意填写;“Filename including extension…”输入完整文件名包括扩展名,如 singboxlink.json
输入描述和完整文件名

二、 添加模板和配置文件

1. 白名单模式(没有命中规则的网络流量统统使用代理,适用于服务器线路网络质量稳定、快速,不缺服务器流量的用户,推荐)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{
  // 出站
  "outbounds": [
    // 手动选择国家或地区节点;根据“国家或地区出站”的名称对 `outbounds` 值进行增删改,须一一对应
    { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "🆓 免费节点" ] },
    { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 全球直连" ] },
    // 选择`🎯 全球直连`为测试本地网络(运营商网络速度和 IPv6 支持情况),可选择其它节点用于测试机场节点速度和 IPv6 支持情况
    { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 全球直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "🆓 免费节点" ] },
    { "tag": "🤖 人工智能", "type": "selector", "outbounds": [ "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] },
    { "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 全球直连", "🚀 节点选择" ] },
    { "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 全球直连", "🚀 节点选择" ] },
    { "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 全球直连", "🚀 节点选择" ] },
    { "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 全球直连", "🚀 节点选择" ] },
    { "tag": "🇨🇳 直连域名", "type": "selector", "outbounds": [ "🎯 全球直连", "🚀 节点选择" ] },
    { "tag": "🇨🇳 直连 IP", "type": "selector", "outbounds": [ "🎯 全球直连", "🚀 节点选择" ] },
    { "tag": "🪜 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 全球直连" ] },
    { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择" ] },
    { "tag": "🔒 私有网络", "type": "selector", "outbounds": [ "🎯 全球直连" ] },
    { "tag": "🛑 广告拦截", "type": "selector", "outbounds": [ "REJECT" ] },
    { "tag": "🎯 全球直连", "type": "selector", "outbounds": [ "DIRECT" ] },
    { "tag": "REJECT", "type": "block" },
    { "tag": "DIRECT", "type": "direct" },
    { "tag": "GLOBAL", "type": "selector", "outbounds": [ "DIRECT", "REJECT", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "🆓 免费节点" ] },
    { "tag": "dns-out", "type": "dns" },

    // 单个出站节点(以 vless 为例)
    {
      "tag": "🆓 免费节点",
      "type": "vless",
      "server": "example.com",
      "server_port": 443,
      "uuid": "{uuid}",
      "network": "tcp",
      "tls": { "enabled": true, "server_name": "example.com", "insecure": false },
      "transport": { "type": "ws", "path": "/?ed=2048", "headers": { "Host": "example.com" } }
    },

    // -------------------- 国家或地区出站 --------------------
    // 自动选择节点,即按照 url 测试结果使用延迟最低的节点;测试后容差大于 50ms 才会切换到延迟低的那个节点;筛选出“香港”节点,支持正则表达式
    { "tag": "🇭🇰 香港节点", "type": "urltest", "tolerance": 50, "providers": [ "🛫 我的机场 1", "🛫 我的机场 2" ], "includes": [ "(?i)港|hk|hongkong|hong kong" ] },
    // 可使用 `"use_all_providers": true` 代替 `"providers": [ "🛫 我的机场 1", "🛫 我的机场 2", ... ]`,意思为引入所有代理集合
    { "tag": "🇹🇼 台湾节点", "type": "urltest", "tolerance": 50, "use_all_providers": true, "includes": [ "(?i)台|tw|taiwan" ] },
    { "tag": "🇯🇵 日本节点", "type": "urltest", "tolerance": 50, "providers": [ "🛫 我的机场 1", "🛫 我的机场 2" ], "includes": [ "(?i)日本|jp|japan" ] },
    { "tag": "🇸🇬 新加坡节点", "type": "urltest", "tolerance": 50, "providers": [ "🛫 我的机场 1", "🛫 我的机场 2" ], "includes": [ "(?i)新|sg|singapore" ] },
    { "tag": "🇺🇸 美国节点", "type": "urltest", "tolerance": 50, "providers": [ "🛫 我的机场 1", "🛫 我的机场 2" ], "includes": [ "(?i)美|us|unitedstates|united states" ] }
  ],
  // 代理集合(获取机场订阅链接内的所有节点)
  "outbound_providers": [
    {
      "tag": "🛫 我的机场 1",
      "type": "remote",
      // 机场订阅链接,使用 Clash 链接
      "download_url": "https://example.com/xxx/xxx&flag=clash",
      "path": "./providers/airport1.yaml",
      "download_interval": "24h",
      "download_ua": "clash.meta",
      // 初步筛选需要的节点,可有效减轻路由器压力,支持正则表达式,若不筛选可删除此配置项
      "includes": [ "香港|台湾|日本|新加坡|美国" ],
      // 初步排除不需要的节点,支持正则表达式,若不排除可删除此配置项
      "excludes": "高倍|×10",
      "healthcheck_url": "https://www.gstatic.com/generate_204",
      "healthcheck_interval": "10m",
      "outbound_override": {
        // 设置出站标签的前缀,如出站标签原为“香港节点”会变成“🛫 我的机场 1-香港节点”;推荐有多个机场时使用
        "tag_prefix": "🛫 我的机场 1-",
        // 设置出站标签的后缀,如出站标签原为“香港节点”会变成“香港节点-🛫 我的机场 1”;推荐有多个机场时使用
        "tag_suffix": "-🛫 我的机场 1"
      }
    },
    {
      "tag": "🛫 我的机场 2",
      "type": "remote",
      "download_url": "https://example.com/xxx/xxx&flag=clash",
      "path": "./providers/airport2.yaml",
      "download_interval": "24h",
      "download_ua": "clash.meta",
      "includes": [ "香港|台湾|日本|新加坡|美国" ],
      "excludes": "高倍|×10",
      "healthcheck_url": "https://www.gstatic.com/generate_204",
      "healthcheck_interval": "10m",
      "outbound_override": {
        // 设置出站标签的前缀,如出站标签原为“香港节点”会变成“🛫 我的机场 2-香港节点”;推荐有多个机场时使用
        "tag_prefix": "🛫 我的机场 2-",
        // 设置出站标签的后缀,如出站标签原为“香港节点”会变成“香港节点-🛫 我的机场 2”;推荐有多个机场时使用
        "tag_suffix": "-🛫 我的机场 2"
      }
    }
  ],
  // 路由
  "route": {
    // 规则
    "rules": [
      { "protocol": [ "dns" ], "outbound": "dns-out" },
      { "clash_mode": [ "Direct" ], "outbound": "DIRECT" },
      { "clash_mode": [ "Global" ], "outbound": "GLOBAL" },
      // 自定义规则优先放前面
      { "geosite": [ "ads" ], "outbound": "🛑 广告拦截" },
      // 为过滤 P2P 流量(BT 下载),可添加一条 `port_range` 规则(ShellCrash 会默认开启“只代理常用端口”,可删除此条 `port_range`)
      { "port_range": [ "6881:6889" ], "outbound": "🎯 全球直连" },
      { "geosite": [ "private" ], "outbound": "🔒 私有网络" },
      { "geosite": [ "microsoft-cn" ], "outbound": "🪟 微软服务" },
      { "geosite": [ "apple-cn" ], "outbound": "🍎 苹果服务" },
      { "geosite": [ "google-cn" ], "outbound": "🇬 谷歌服务" },
      { "geosite": [ "games-cn" ], "outbound": "🎮 游戏服务" },
      { "geosite": [ "ai" ], "outbound": "🤖 人工智能" },
      { "geosite": [ "networktest" ], "outbound": "📈 网络测试" },
      { "geosite": [ "proxy" ], "outbound": "🪜 代理域名" },
      { "geosite": [ "cn" ], "outbound": "🇨🇳 直连域名" },
      { "geoip": [ "telegram" ], "outbound": "📲 电报消息", "skip_resolve": true },
      { "geoip": [ "private" ],  "outbound": "🔒 私有网络", "skip_resolve": true },
      { "geoip": [ "cn" ], "outbound": "🇨🇳 直连 IP" }
    ],
    // geosite 配置项
    "geosite": {
      "path": "./geosite.db",
      "download_url": "https://cdn.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box/geosite.db"
    },
    // geoip 配置项
    "geoip": {
      "path": "./geoip.db",
      "download_url": "https://cdn.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box/geoip.db"
    },
    // 默认出站,即没有命中规则的域名或 IP 走该规则
    "final": "🐟 漏网之鱼",
    "auto_detect_interface": true,
    "concurrent_dial": true
  }
}

将模板内容复制到自己 Gist 新建的 .json 文件中
贴一张面板效果图(举个例子:我手动选择 🇹🇼 台湾节点 策略组,而该策略组是将机场内所有台湾节点按照 url 测试结果自动选择延迟最低的台湾节点):
面板效果图

2. 黑名单模式(只有命中规则的网络流量才使用代理,适用于服务器线路网络质量不稳定或不够快,或服务器流量紧缺的用户。通常也是软路由用户、家庭网关用户的常用模式)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
  // 出站
  "outbounds": [
    // 手动选择国家或地区节点;根据“国家或地区出站”的名称对 `outbounds` 值进行增删改,须一一对应
    { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "🆓 免费节点" ] },
    { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🎯 全球直连", "🚀 节点选择" ] },
    // 选择`🎯 全球直连`为测试本地网络(运营商网络速度和 IPv6 支持情况),可选择其它节点用于测试机场节点速度和 IPv6 支持情况
    { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 全球直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "🆓 免费节点" ] },
    { "tag": "🤖 人工智能", "type": "selector", "outbounds": [ "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇰🇷 韩国节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] },
    { "tag": "🪜 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 全球直连" ] },
    { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择" ] },
    { "tag": "🛑 广告拦截", "type": "selector", "outbounds": [ "REJECT" ] },
    { "tag": "🎯 全球直连", "type": "selector", "outbounds": [ "DIRECT" ] },
    { "tag": "REJECT", "type": "block" },
    { "tag": "DIRECT", "type": "direct" },
    { "tag": "PROXY", "type": "urltest", "tolerance": 50, "use_all_providers": true },
    { "tag": "GLOBAL", "type": "selector", "outbounds": [ "DIRECT", "REJECT", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "🆓 免费节点" ] },
    { "tag": "dns-out", "type": "dns" },

    // 单个出站节点(以 vless 为例)
    {
      "tag": "🆓 免费节点",
      "type": "vless",
      "server": "example.com",
      "server_port": 443,
      "uuid": "{uuid}",
      "network": "tcp",
      "tls": { "enabled": true, "server_name": "example.com", "insecure": false },
      "transport": { "type": "ws", "path": "/?ed=2048", "headers": { "Host": "example.com" } }
    },

    // -------------------- 国家或地区出站 --------------------
    // 自动选择节点,即按照 url 测试结果使用延迟最低的节点;测试后容差大于 50ms 才会切换到延迟低的那个节点;筛选出“香港”节点,支持正则表达式
    { "tag": "🇭🇰 香港节点", "type": "urltest", "tolerance": 50, "providers": [ "🛫 我的机场 1", "🛫 我的机场 2" ], "includes": [ "(?i)港|hk|hongkong|hong kong" ] },
    // 可使用 `"use_all_providers": true` 代替 `"providers": [ "🛫 我的机场 1", "🛫 我的机场 2", ... ]`,意思为引入所有代理集合
    { "tag": "🇹🇼 台湾节点", "type": "urltest", "tolerance": 50, "use_all_providers": true, "includes": [ "(?i)台|tw|taiwan" ] },
    { "tag": "🇯🇵 日本节点", "type": "urltest", "tolerance": 50, "providers": [ "🛫 我的机场 1", "🛫 我的机场 2" ], "includes": [ "(?i)日本|jp|japan" ] },
    { "tag": "🇸🇬 新加坡节点", "type": "urltest", "tolerance": 50, "providers": [ "🛫 我的机场 1", "🛫 我的机场 2" ], "includes": [ "(?i)新|sg|singapore" ] },
    { "tag": "🇺🇸 美国节点", "type": "urltest", "tolerance": 50, "providers": [ "🛫 我的机场 1", "🛫 我的机场 2" ], "includes": [ "(?i)美|us|unitedstates|united states" ] }
  ],
  // 代理集合(获取机场订阅链接内的所有节点)
  "outbound_providers": [
    {
      "tag": "🛫 我的机场 1",
      "type": "remote",
      // 机场订阅链接,使用 Clash 链接
      "download_url": "https://example.com/xxx/xxx&flag=clash",
      "path": "./providers/airport1.yaml",
      "download_interval": "24h",
      "download_ua": "clash.meta",
      "download_detour": "PROXY",
      // 初步筛选需要的节点,可有效减轻路由器压力,支持正则表达式,若不筛选可删除此配置项
      "includes": [ "香港|台湾|日本|新加坡|美国" ],
      // 初步排除不需要的节点,支持正则表达式,若不排除可删除此配置项
      "excludes": "高倍|×10",
      "healthcheck_url": "https://www.gstatic.com/generate_204",
      "healthcheck_interval": "10m",
      "outbound_override": {
        // 设置出站标签的前缀,如出站标签原为“香港节点”会变成“🛫 我的机场 1-香港节点”;推荐有多个机场时使用
        "tag_prefix": "🛫 我的机场 1-",
        // 设置出站标签的后缀,如出站标签原为“香港节点”会变成“香港节点-🛫 我的机场 1”;推荐有多个机场时使用
        "tag_suffix": "-🛫 我的机场 1"
      }
    },
    {
      "tag": "🛫 我的机场 2",
      "type": "remote",
      "download_url": "https://example.com/xxx/xxx&flag=clash",
      "path": "./providers/airport2.yaml",
      "download_interval": "24h",
      "download_ua": "clash.meta",
      "download_detour": "PROXY",
      "includes": [ "香港|台湾|日本|新加坡|美国" ],
      "excludes": "高倍|×10",
      "healthcheck_url": "https://www.gstatic.com/generate_204",
      "healthcheck_interval": "10m",
      "outbound_override": {
        // 设置出站标签的前缀,如出站标签原为“香港节点”会变成“🛫 我的机场 2-香港节点”;推荐有多个机场时使用
        "tag_prefix": "🛫 我的机场 2-",
        // 设置出站标签的后缀,如出站标签原为“香港节点”会变成“香港节点-🛫 我的机场 2”;推荐有多个机场时使用
        "tag_suffix": "-🛫 我的机场 2"
      }
    }
  ],
  // 路由
  "route": {
    // 规则
    "rules": [
      { "protocol": [ "dns" ], "outbound": "dns-out" },
      { "clash_mode": [ "Direct" ], "outbound": "DIRECT" },
      { "clash_mode": [ "Global" ], "outbound": "GLOBAL" },
      // 自定义规则优先放前面
      { "geosite": [ "ads" ], "outbound": "🛑 广告拦截" },
      { "geosite": [ "ai" ], "outbound": "🤖 人工智能" },
      { "geosite": [ "networktest" ], "outbound": "📈 网络测试" },
      { "geosite": [ "proxy" ], "outbound": "🪜 代理域名" },
      { "geoip": [ "telegram" ], "outbound": "📲 电报消息", "skip_resolve": true }
    ],
    // geosite 配置项
    "geosite": {
      "path": "./geosite.db",
      "download_url": "https://cdn.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box/geosite.db",
      "download_detour": "PROXY"
    },
    // geoip 配置项
    "geoip": {
      "path": "./geoip.db",
      "download_url": "https://cdn.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box/geoip.db",
      "download_detour": "PROXY"
    },
    // 默认出站,即没有命中规则的域名或 IP 走该规则
    "final": "🐟 漏网之鱼",
    "auto_detect_interface": true,
    "concurrent_dial": true
  }
}

将模板内容复制到自己 Gist 新建的 .json 文件中

三、 修改模板

  1. 将代理集合 outbound_providers 中的 download_url 链接改成自己机场的订阅链接(必须为 Clash 订阅链接,详见《前言:4》)
  2. 确定自己机场中有哪些国家或地区的节点,然后对模板文件里 outbounds 中的“国家或地区出站”以及 🚀 节点选择📈 网络测试🤖 人工智能GLOBAL 下的 outbounds 里面的国家或地区进行增删改
    • 注:两者中的国家或地区必须一一对应,新增就全部新增,删除就全部删除,修改就全部修改(重要)
  3. 在“国家或地区出站”中的 includes 支持正则表达式,可以精确地筛选出指定的国家或地区节点
    例如:我想筛选出“香港 IPLC”节点,includes 可以这样写:"includes": [ "香港.*IPLC|IPLC.*香港" ]
    • 小窍门:使用 ChatGPT 等 AI 工具查询符合自己要求的正则表达式
  4. 🚀 节点选择 出站下的 outbounds 里,可以将最稳定的节点放在最前面,配置完成后会自动选择最稳定的节点
  5. 在“国家或地区出站”里,typeurltest 就是自动选择延迟最低的节点,将 urltest 改成 selector 就是手动选择节点
    举个例子:我的机场包含有 2 个节点,分别是新加坡节点和日本节点,我想让 Netflix 自动选择延迟最低的新加坡节点,哔哩哔哩可以手动选择日本任一节点,这个需求怎么写?
    注:
      1. 以下只是节选,请酌情套用
      1. 本教程搭配的路由规则文件包含有 netflixbilibili
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  // 出站
  "outbounds": [
    // 默认选择新加坡节点
    { "tag": "🎥 奈飞视频", "type": "selector", "outbounds": [ "🇸🇬 新加坡节点" ] },
    // 默认选择日本节点,也可切换到直连
    { "tag": "📺 哔哩哔哩", "type": "selector", "outbounds": [ "🇯🇵 日本节点", "🎯 全球直连" ] },
    // 自动选择延迟最低的新加坡节点;容差大于 50ms 才会切换到延迟低的那个节点
    { "tag": "🇸🇬 新加坡节点", "type": "urltest", "tolerance": 50, "use_all_providers": true, "includes": [ "(?i)(新|sg|singapore)" ] },
    // 手动选择日本任一节点
    { "tag": "🇯🇵 日本节点", "type": "selector", "use_all_providers": true, "includes": [ "(?i)日本|jp|japan" ] },
    { "tag": "🎯 全球直连", "type": "selector", "outbounds": [ "DIRECT" ] },
    { "tag": "DIRECT", "type": "direct" }
  ],
  // 路由
  "route": {
    // 规则
    "rules": [
      // 自定义规则优先放前面
      { "geosite": [ "netflix" ], "outbound": "🎥 奈飞视频" },
      { "geoip": [ "netflix" ], "outbound": "🎥 奈飞视频", "skip_resolve": true  },
      { "geosite": [ "bilibili" ], "outbound": "📺 哔哩哔哩" }
    ]
  }
}
  1. 若有其它需求,可以导入 MetaCubeX/meta-rules-dat 路由规则文件,并分别进入 MetaCubeX/meta-rules-dat/sing/geogeositegeoip 目录搜索关键字,通过能够搜索到的关键字来编写规则

四、 生成 .json 文件链接

  1. 编辑完成后,点击右下角的“Create secret gist”按钮,然后点击右上角的“Raw”按钮
    生成 .json 文件链接 1

  2. 取出地址栏中的网址,删除后面的一串随机码,完成后该 .json 文件直链才是最终生成的订阅链接,该订阅链接地址不会改变,在不更改文件名的情况下即使编辑该 .json 文件并提交了 n 次也不会改变。举个例子,这是原地址:
    https://gist.githubusercontent.com/DustinWin/40c0611fda5d6fcd0795ee5a15de7c73/raw/b3c63051134510ae9825068bbcf5219817761f57/singboxlink.json
    删除后面的一串随机码(当前编辑该文件生成的随机码“b3c63051134510ae9825068bbcf5219817761f57”)
    生成 .json 文件链接 2
    删除后变成:
    https://gist.githubusercontent.com/DustinWin/40c0611fda5d6fcd0795ee5a15de7c73/raw/singboxlink.json

五、 导入订阅链接(以 ShellCrash 导入订阅链接为例)

  1. 连接 SSH 后执行命令 mkdir -p $CRASHDIR/providers/
    • 注:因 outbound_providers 代理集合配置的 path 路径中含有文件夹“providers”,须手动新建此文件夹才能使 .yaml 订阅文件保存到本地,否则将保存到内存中(每次启动服务都要重新下载)
  2. 进入 ShellCrash 配置脚本 -> 6 -> 2,粘贴最终生成的订阅链接即可,具体设置请参考《ShellCrash 搭载 sing-boxp 内核的配置-geodata 方案
本文由作者按照 CC BY 4.0 进行授权