From 141d16c0df90cecaa6ffad7a3bb96a0e155aca3c Mon Sep 17 00:00:00 2001 From: 2022-blake3-chacha12-poly1305 <139959885+xchacha20-ietf-poly1305@users.noreply.github.com> Date: Sat, 19 Aug 2023 16:01:16 +0800 Subject: [PATCH] fix: automatic set TLS for Trojan but not for VLESS --- fmt/Link2Bean.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fmt/Link2Bean.cpp b/fmt/Link2Bean.cpp index 790e980..2141c85 100644 --- a/fmt/Link2Bean.cpp +++ b/fmt/Link2Bean.cpp @@ -55,7 +55,11 @@ namespace NekoGui_fmt { // security stream->network = GetQueryValue(query, "type", "tcp"); - stream->security = GetQueryValue(query, "security", "tls").replace("reality", "tls"); + if (proxy_type == proxy_Trojan) { + stream->security = GetQueryValue(query, "security", "tls").replace("reality", "tls").replace("none", ""); + } else { + stream->security = GetQueryValue(query, "security", "").replace("reality", "tls").replace("none", ""); + } auto sni1 = GetQueryValue(query, "sni"); auto sni2 = GetQueryValue(query, "peer"); if (!sni1.isEmpty()) stream->sni = sni1;