clash2singbox icon indicating copy to clipboard operation
clash2singbox copied to clipboard

生成使用机场中继的配置

Open loveqianool opened this issue 1 year ago • 1 comments

如下将筛选出的节点加上 "detour": "落地1"

    {
      "server": "172.0.0.77",
      "server_port": 9090,
      "tag": "落地1",
      "type": "ss"
    },
    {
      "tag": "中继落地1",
      "type": "selector",
      "outbounds": [
        "include: hk|HK|港|IEPL|iepl|IPLC|iplc"
      ],
       "detour": "落地1"
    }

loveqianool avatar May 17 '24 05:05 loveqianool

不明白你的意思,xmdhs/clash2sfa 不是可以这样做吗

xmdhs avatar May 17 '24 15:05 xmdhs

不明白你的意思,xmdhs/clash2sfa 不是可以这样做吗

现在上面的配置会生成

        {
            "outbounds": [
                "hk1"
            ],
            "tag": "中继落地1",
            "type": "selector",
            "detour": "落地1"
        },

而 sing-box 的 selector 不支持 detour。 我是想用机场的节点进行链式代理。 如上面筛选出了 hk1hk2,应该先复制两个 落地1 的配置,在里面插入筛选出 tag "detour": "hk1""detour": "hk2",并修改 tag。

    {
      "server": "172.0.0.77",
      "server_port": 9090,
      "tag": "hk1 - 落地1",
      "type": "ss",
      "detour": "hk1"
    },
    {
      "server": "172.0.0.77",
      "server_port": 9090,
      "tag": "hk2 - 落地1",
      "type": "ss",
      "detour": "hk2"
    },

然后再使用 修改的 tag 生成 selector。

    {
      "tag": "中继落地1",
      "type": "selector",
      "outbounds": [
        "hk1 - 落地1",
        "hk2 - 落地1"
      ]
    }

这样我在 中继落地1 这个组中选择 hk1 - 落地1,流量会先走 机场的 hk1 再走到我的 落地1,实现使用机场的代理进行流量中转。

loveqianool avatar May 21 '24 09:05 loveqianool

https://github.com/xmdhs/clash2sfa/commit/63cc2d099a72666c1b67fdef439e1e188fd8e780 上已支持

xmdhs avatar Jul 16 '24 15:07 xmdhs

xmdhs/clash2sfa@63cc2d0 上已支持

路由走反了,现在生成的配置会从落地节点走到机场。 流量 > 落地 > 机场 > 目的地 这样走了,变成了使用我的节点给机场进行中继。

loveqianool avatar Jul 19 '24 15:07 loveqianool

http://sing-box.sagernet.org/zh/configuration/shared/dial/

detour

上游出站的标签。

启用时,其他拨号字段将被忽略。

我们需要筛选出上游出站标签插入到落地配置中,而不是筛选出完整配置插入落地标签。

loveqianool avatar Jul 19 '24 16:07 loveqianool

试试 https://github.com/xmdhs/clash2sfa/commit/45c9eaf5b1b3e3da2c807aa9c39df3e5f6b907c3

xmdhs avatar Jul 20 '24 08:07 xmdhs

试试 xmdhs/clash2sfa@45c9eaf

没问题了,感谢大佬。

loveqianool avatar Jul 20 '24 18:07 loveqianool