daeuniverse / dae

eBPF-based Linux high-performance transparent proxy solution.
GNU Affero General Public License v3.0
2.62k stars 165 forks source link

[Bug Report] hy2 does not support sing-box as a backend #552

Closed douglarek closed 1 week ago

douglarek commented 1 week ago

Checks

Current Behavior

sing-box server:

    {
      "type": "hysteria2",
      "listen": "::",
      "listen_port": 443,
      "users": [{
        "password": "bar"
      }],
      "tls": {
        "enabled": true,
        "server_name": "a.b.xyz",
        "acme": {
          "domain": "a.b.xyz",
          "email": "i@examle.com"
        }
      }
    }

dae config:

a: 'hy2://bar@a.b.xyz:443'

dae log:

level=warning msg="handleConn: failed to dial xxxx:80: connect error: CRYPTO_ERROR 0x178 (remote): tls: no application protocol"

If use the original server-side program of hy2, there will be no problem.

Expected Behavior

...

Steps to Reproduce

...

Environment

Anything else?

No response

dae-prow[bot] commented 1 week ago

Thanks for opening this issue!

xmapst commented 1 week ago

尝试使用hy2原版的客户端程序连接试试 如果也连接不上 就是sing-box问题

douglarek commented 1 week ago

a workaround of sing-box on the server side is to add an extra alpn:

      "tls": {
        "enabled": true,
        "server_name": "example.com",
        "alpn": "h3",
        "acme": {
          "domain": "example.com",
          "email": "i@example.com"
        }
      }

If using clash meta as the hy2 client, and sing-box as the server, this method should also be feasible.