surgioproject / surgio

Generating rules for Surge, Clash, Quantumult like a PRO
https://surgio.js.org
MIT License
1.62k stars 138 forks source link

feat(singbox): Support network=tcp in VMESS/VLESS #274

Closed cnsunyour closed 5 months ago

cnsunyour commented 5 months ago

singbox 的 vmess/vless 节点不用必须指定 transport ,也就是 surgio 里的 network 可以是默认值 tcp 。 我的 server 端用 singbox 配置的 vless+vision+reality 节点,本地修改后测试连接成功。 不过没有 vmess 节点,因此只测试了 vless ,并未测试 vmess ,只是根据文档中描述 transport 为非必须项,

netlify[bot] commented 5 months ago

Deploy Preview for surgio-documentation failed.

Name Link
Latest commit 6b353605120b737ca7db823c95bd3f1a441e5538
Latest deploy log https://app.netlify.com/sites/surgio-documentation/deploys/668005453f931a00081f7706
geekdada commented 5 months ago

感谢共享代码。之前Singbox的支持也是社区贡献的,可能遗漏了这个点。麻烦可以顺便看看测试用例吗?

cnsunyour commented 5 months ago

好的,我修改后生成的 singbox 配置的 vless 节点是这样:

    {
      "type": "vless",
      "tag": "自建A2",
      "server": "www.example.com",
      "server_port": 12345,
      "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "flow": "xtls-rprx-vision",
      "tls": {
        "enabled": true,
        "utls": {
          "enabled": true,
          "fingerprint": "chrome"
        },
        "reality": {
          "enabled": true,
          "public_key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
          "short_id": "xxxxxxxxxxxxx"
        },
        "server_name": "www.example.com"
      }
    }

对应的 surgio provider 配置是这样:

    {
      nodeName: "自建A2",
      type: "vless",
      hostname: "www.example.com",
      method: "none",
      network: "tcp",
      port: 12345,
      uuid: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      flow: "xtls-rprx-vision",
      sni: "www.example.com",
      udpRelay: true,
      clientFingerprint: "chrome",
      realityOpts: {
        shortId: "xxxxxxxxxxxxx",
        publicKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      }
    }
geekdada commented 5 months ago

可以修改一下用例吗,通过 CI 就能合并了

cnsunyour commented 5 months ago

噢噢,我试着改一下。抱歉之前没理解意思。

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.80%. Comparing base (31d4aab) to head (6b35360). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #274 +/- ## ======================================= Coverage 75.79% 75.80% ======================================= Files 66 66 Lines 2768 2769 +1 Branches 720 720 ======================================= + Hits 2098 2099 +1 Misses 412 412 Partials 258 258 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

geekdada commented 5 months ago

感谢!