Fix bug on Surge when using WebSocket (#532)

* Fix bug on Surge when using WebSocket.

* Change sni from host to hostname
This commit is contained in:
Vincent Young
2022-08-31 16:24:53 +08:00
committed by GitHub
parent 8e0389d7f2
commit 35d296553b

View File

@@ -679,7 +679,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=" + host + ", ws-headers=Host:" + host;
if(host.empty())
proxy += ", ws=true, ws-path=" + path + ", sni=" + hostname;
else
proxy += ", ws=true, ws-path=" + path + ", sni=" + hostname + ", ws-headers=Host:" + host;
if(!edge.empty())
proxy += "|Edge:" + edge;
break;