From 80363459f29da9fcde2150b1e81d03a2ab746ce4 Mon Sep 17 00:00:00 2001 From: Tsung Wu Date: Fri, 1 Aug 2025 21:08:59 +0800 Subject: [PATCH] fix: some vless nodes not exported on loon --- scripts/Dockerfile | 2 +- src/generator/config/subexport.cpp | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/Dockerfile b/scripts/Dockerfile index b35bd73..d6b5552 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -37,7 +37,7 @@ RUN set -xe && \ cmake -DCMAKE_CXX_STANDARD=11 . && \ make install -j $THREADS && \ cd .. && \ - git clone https://github.com/asdlokj1qpi233/subconverter --depth=1 && \ + git clone https://github.com/ionull/subconverter --depth=1 && \ cd subconverter && \ [ -n "$SHA" ] && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h;\ python3 -m ensurepip && \ diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index 6ee0c61..dbb0ca2 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -2260,18 +2260,30 @@ proxyToLoon(std::vector &nodes, const std::string &base_conf, break; case ProxyType::VLESS: if (flow != "xtls-rprx-vision") { - continue; + if (transproto == "ws") { + proxy = "VLESS," + hostname + "," + port + ",\"" + id + "\"" + + ",path=" + path + ",host=" + host + ",transproto=" + transproto + + ",udp=" + (udp.get() ? "true" : "false") + ",over-tls=" + ( + tlssecure ? "true" : "false") + ",sni=" + sni; + } else { + continue; + } + } else { + proxy = "VLESS," + hostname + "," + port + ",\"" + id + "\",flow=" + flow + ",public-key=\"" + pk + + "\",short-id=" + shortId + ",udp=" + (udp.get() ? "true" : "false") + ",over-tls=" + ( + tlssecure ? "true" : "false") + ",sni=" + sni; } - proxy = "VLESS," + hostname + "," + port + ",\"" + id + "\",flow=" + flow + ",public-key=\"" + pk + - "\",short-id=" + shortId + ",udp=" + (udp.get() ? "true" : "false") + ",over-tls=" + ( - tlssecure ? "true" : "false") + ",sni=" + sni; switch (hash_(transproto)) { case "tcp"_hash: proxy += ",transport=tcp"; break; default: - continue; + if (transproto != "ws") { + continue; + } else { + break;; + } } if (!scv.is_undef()) proxy += ",skip-cert-verify=" + std::string(scv.get() ? "true" : "false");