记录一次 singbox 节点分流

记录一次 singbox 节点分流

由于我使用的 HK 节点无法使用 Gemini, 这让我非常苦恼, 我就去了解了一下这方面的东西, 发现 分流 功能正是我所需要的, 接下来开始操作:

准备

至少两台 VPS

开始

HK 的设备创建一个 tcp-reality 节点, 分流的 VPS 创建一个 SS 节点即可, 怎么创建这里不再赘述, 可以参考 233boy 的脚本, 需要注意的是我们需要记录下 SS 节点的相关信息包括: 端口, 密码, 加密方式

之后找到 singbox 的安装目录, 我的是在 /etc/sing-box/ 下, 我们再进入 conf 文件夹中, 如果节点已经创建完毕的话不出意外目录下应该有一个 json 的文件, 我们进行这个文件的编辑

 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
{
  "inbounds": [
    {
      "tag": "VLESS-REALITY-xxxxx.json",
      "type": "vless",
      "listen": "::",
      "listen_port": xxxxx,
      "sniff": true, 
      "sniff_override_destination": true,
      "users": [
        {
          "flow": "xtls-rprx-vision",
          "uuid": "415f6605-xxxxx-4768-bd15-xxxxxxxxx"
        }
      ],
      "tls": {
        "enabled": true,
        "server_name": "www.apple.com",
        "reality": {
          "enabled": true,
          "handshake": {
            "server": "www.apple.com",
            "server_port": 443
          },
          "private_key": "xxxx_xxxxx_-xxxxxxxxxxx",
          "short_id": [
            ""
          ]
        }
      }
    }
  ],
  "route": {
    "final": "direct-out",
    "rules": [
        {
        "action": "route",
        "domain_keyword": ["gemini.google.com"],
        "outbound": "ss-gemini-node"
        }
    ]
},
  "outbounds": [
    {
      "tag": "ss-gemini-node",
      "type": "shadowsocks",
      "server": "1.2.3.4",
      "server_port": 5345,
      "method": "aes-128-gcm",
      "password": "password"
    },
    {
      "tag": "direct-out",
      "type": "direct"
    },
    {
      "tag": "public_key_xxxxxxxxxxxxxxxx",
      "type": "direct"
    }
  ]
}

按照上面我的配置填入自己的配置即可分流, 修改完毕后可以执行一下下面的命令验证一下配置文件是否有语法错误:

1
check -c /etc/sing-box/conf/VLESS-REALITY-xxxx.json 

没有任何错误输出的话就可以重启一下 singbox 来让配置生效了

1
systemctl restart sing-box

之后可以观察日志查看是否分流成功

1
tail -f /var/log/sing-box/access.log
updatedupdated2026-01-292026-01-29