Use Host as SNI field if exists in Surge configs (#674)

This commit is contained in:
RuyeNet 2023-11-27 00:14:47 +08:00 committed by GitHub
parent 05a542c4f1
commit fdf983bc1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -722,7 +722,10 @@ std::string proxyToSurge(std::vector<Proxy> &nodes, const std::string &base_conf
case "tcp"_hash:
break;
case "ws"_hash:
proxy += ", ws=true, ws-path=" + path + ", sni=" + hostname;
if(host.empty())
proxy += ", ws=true, ws-path=" + path + ", sni=" + hostname;
else
proxy += ", ws=true, ws-path=" + path + ", sni=" + host;
if(!host.empty())
headers.push_back("Host:" + host);
if(!edge.empty())