Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当订阅包含vless时所有节点不可用 #10

Closed
yueyejinghun opened this issue Sep 11, 2023 · 7 comments
Closed

当订阅包含vless时所有节点不可用 #10

yueyejinghun opened this issue Sep 11, 2023 · 7 comments

Comments

@yueyejinghun
Copy link

yueyejinghun commented Sep 11, 2023

Operating system

Windows

System version

Windows 11

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version

Environment: go1.21.0 windows/amd64
Tags: with_quic,with_grpc,with_reality_server,with_utls,with_clash_api,with_gvisor
Revision: aacda975d53edbd4339f2a020888a913079d7143
CGO: enabled

Description

BASE64 转换后节点配置如下

vless://UUID@IP:443?mode=multi&security=reality&encryption=none&type=tcp&flow=xtls-rprx-vision&servername=servername&pbk=pbk&sid=sid&sni=sni&fp=chrome&spx=节点名
trojan://UUID@IP:443?allowInsecure=0&peer=peer&sni=sni#节点名

可正确导入其他非 vless 节点,但所有节点不可用。未包含 vless 的机场导入与使用无任何问题

参考过 #5 ,但是可成功导入的节点依旧无法使用,如 trojan 配置并不包含 &type=tcp

尝试过使用 exclude 排除 vless 节点,无效;使用 订阅链接&flag=clash 方式获取不包含 vless 的节点,提示无法导入(这个应该不算 bug)。

由于 sing-box 本身支持 vless+REALITY,请问是否可以修复?

谢谢

Reproduction

导入包含 vless 的机场链接,若需要可私发。

Logs

2023-09-11 21:25:09 �[33mWARN�[0m provider[sub1]: links parsed with error:unsupported link scheme: vless

Edit 1: 补充说明
Edit 2: 补充 trojan 配置

@qjebbs
Copy link
Owner

qjebbs commented Sep 12, 2023

两点:

  • 不支持vless链接,我也没找到 vless 链接的规范。
  • vless以外的节点应能正常使用,若不能,是bug

@yueyejinghun
Copy link
Author

两点:

  • 不支持vless链接,我也没找到 vless 链接的规范。
  • vless以外的节点应能正常使用,若不能,是bug

感谢解答,实际上也并不是一定要用 vless 节点,奇怪的是无论排除不排除 vless, trojan 节点都无法使用。

把日志调整到 trace 级别以后点击测试按扭也只有一堆很笼统的错误提示

+0800 2023-09-12 17:08:42 DEBUG [1605505826 15.0s] inbound/tun[0]: connection closed: upload: read udp “IP”:3478: i/o timeout | upstream: context canceled | download: read udp [::]:56332: use of closed network connection

trojan 节点解析看起来也一切正常 (随便过滤的一个节点域名获取的上下文相关日志)

+0800 2023-09-12 17:09:43 INFO provider/trojan[sub1 节点名]: outbound connection to www.gstatic.com:80
+0800 2023-09-12 17:09:43 DEBUG dns: lookup domain “DOMAIN”
+0800 2023-09-12 17:09:48 DEBUG dns: exchanged “DOMAIN” NOERROR 42
+0800 2023-09-12 17:09:48 DEBUG dns: exchanged ”DOMAIN“ A ”DOMAIN“. 42 IN A ”IP“
+0800 2023-09-12 17:09:48 DEBUG dns: exchanged “DOMAIN” OPT OPT PSEUDOSECTION: EDNS: version 0 flags: MBZ: 0x002a, udp: 4096
+0800 2023-09-12 17:09:48 DEBUG dns: match[7] outbound=any => localDns
+0800 2023-09-12 17:09:49 DEBUG dns: lookup succeed for “DOMAIN”: ”IP“

如果无法通过本项目解决这个问题,请关闭 issue。无论如何,都非常感谢这个项目提供的便利

@qjebbs
Copy link
Owner

qjebbs commented Sep 12, 2023

yacd 里有相应节点就说明加载成功了。若节点不能用

BASE64 转换后节点配置里,找一个链接,执行命令sing-box ping "<link>",看能不能通。

@yueyejinghun
Copy link
Author

yueyejinghun commented Sep 12, 2023

非常感谢,sing-box ping "<link>" 的结果如下,初步判断应该是机场配置有问题

{
  "type": "trojan",
  "tag": "节点名",
  "server": "DOMAIN",
  "server_port": 443,
  "password": "UUID",
  "tls": {
    "enabled": true,
    "server_name": "SNI"
  }
}

sing-box ping (version unknown)
Ping http://www.google.com/gen_204: seq=1 err remote error: tls: unrecognized name
Ping http://www.google.com/gen_204: seq=2 err remote error: tls: unrecognized name
Ping http://www.google.com/gen_204: seq=3 err remote error: tls: unrecognized name
Ping http://www.google.com/gen_204: seq=4 err remote error: tls: unrecognized name

但我尝试了一下,把这个节点手动添加到 config.json 文件里,yacd 点击测试的时候这个节点没有结果,但却是正常可用的。

trojan://UUID@DOMAIN:443?allowInsecure=0&peer=PEER&sni=SNI#节点名
    {
      "tag": "节点名",
      "type": "trojan",
      "server": "DOMAIN",
      "server_port": 443,
      "password": "UUID",
      "tls": {
        "enabled": true,
        "insecure": false,
        "disable_sni": false,
        "server_name": "SNI",
        "utls": {
          "enabled": true,
          "fingerprint": "chrome"
        }
      }
    }

直接选择订阅中的相同节点,依旧不可用

在 json 中我没有添加 peer(主要不知道在哪里添加),但另一可正常使用的机场链接中包含 peer,可能关系不大

Edit1: 补充运行 sing-box ping "<link>" 时生成的配置

@yueyejinghun
Copy link
Author

原因已找到

因为此订阅 serversni 的值不同,在节点链接转换过程中会忽略节点链接中 sni,在生成的最终配置中直接使用 server 的值,导致节点无法使用

@qjebbs
Copy link
Owner

qjebbs commented Sep 13, 2023

试下最新的

@yueyejinghun
Copy link
Author

已修复,非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants