Add SNI host support in Surge configurations

This commit is contained in:
Tindy X committed 2020-03-28 23:38:50 +08:00
1 parent 6562a5642e
commit 7f2df3b2af
1 file changed
+6 -2
+6 -2
View File
@@ -1301,8 +1301,12 @@ bool explodeSurge(std::string surge, const std::string &custom_port, int local_p
continue; continue;
itemName = trim(vArray[0]); itemName = trim(vArray[0]);
itemVal = trim(vArray[1]); itemVal = trim(vArray[1]);
if(itemName == "password") switch(hash_(itemName))
password = itemVal; {
case "password"_hash: password = itemVal; break;
case "sni"_hash: host = itemVal; break;
default: continue;
}
} }
if(host.empty() && !isIPv4(server) && !isIPv6(server)) if(host.empty() && !isIPv4(server) && !isIPv6(server))
host = server; host = server;