Do not add obfs-host to Surge Snell node if empty (#626)

* fix surge obfs-host empty error

* fix comma error
This commit is contained in:
Kenneth 2023-07-26 13:07:30 +08:00 committed by GitHub
parent 7d9881b9bc
commit a7e441a2fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -754,7 +754,9 @@ std::string proxyToSurge(std::vector<Proxy> &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;