fix: servername/sni priority over wss host

This commit is contained in:
xream
2023-08-22 18:21:34 +08:00
parent b2384a8736
commit 95b3b046f3
2 changed files with 11 additions and 1 deletions

View File

@@ -295,6 +295,16 @@ function Clash_All() {
if (proxy.type === 'vmess') {
proxy.sni = proxy.servername;
delete proxy.servername;
if (proxy.tls && !proxy.sni) {
if (proxy.network === 'ws') {
proxy.sni = proxy['ws-opts']?.headers?.Host;
} else if (proxy.network === 'http') {
let httpHost = proxy['http-opts']?.headers?.Host;
proxy.sni = Array.isArray(httpHost)
? httpHost[0]
: httpHost;
}
}
}
return proxy;