fix: servername/sni priority over wss host

This commit is contained in:
xream 2023-08-22 18:21:34 +08:00
parent feb207b333
commit 497bc264e3
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.20",
"version": "2.14.21",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {

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;