From a7e441a2fe6741957d6d4514581d59f366308677 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Wed, 26 Jul 2023 13:07:30 +0800 Subject: [PATCH] Do not add obfs-host to Surge Snell node if empty (#626) * fix surge obfs-host empty error * fix comma error --- src/generator/config/subexport.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index 6dcb9fc8f..dbeff7fac 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -754,7 +754,9 @@ std::string proxyToSurge(std::vector &nodes, const std::string &base_conf case ProxyType::Snell: proxy = "snell, " + hostname + ", " + port + ", psk=" + password; if(!obfs.empty()) - proxy += ", obfs=" + obfs + ", obfs-host=" + host; + proxy += ", obfs=" + obfs; + if(!host.empty()) + proxy += ", obfs-host=" + host; break; default: continue;