diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index 36f6269a5..46c272773 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -697,9 +697,10 @@ void proxyToClash(std::vector &nodes, YAML::Node &yamlnode, const ProxyGr // Fallback for backward compatibility singleproxy["flow"] = x.Flow; } - if (!x.PublicKey.empty() && !x.ShortID.empty()) { + if (!x.PublicKey.empty()) { singleproxy["reality-opts"]["public-key"] = x.PublicKey; - singleproxy["reality-opts"]["short-id"] = x.ShortID; + if (!x.ShortID.empty()) + singleproxy["reality-opts"]["short-id"] = x.ShortID; if (!x.ClientFingerprint.empty()) { singleproxy["client-fingerprint"] = x.ClientFingerprint; } else if (!x.Fingerprint.empty()) { @@ -2804,7 +2805,7 @@ void proxyToSingBox(std::vector &nodes, rapidjson::Document &json, std::v tls.AddMember("alpn", alpn, allocator); } - if (!x.PublicKey.empty() && !x.ShortID.empty()) { + if (!x.PublicKey.empty()) { rapidjson::Value reality(rapidjson::kObjectType); reality.AddMember("enabled", true, allocator); if (!x.PublicKey.empty())