preserve ws-headers for vmess in Surge (#49)

This commit is contained in:
Matthew Wo
2021-09-03 16:41:07 +08:00
committed by GitHub
parent c534a64ebc
commit 71d7f35b06
2 changed files with 6 additions and 5 deletions

View File

@@ -2598,9 +2598,10 @@ var ProxyUtils = (function () {
}`;
if (proxy.network === "ws") {
const path = proxy["ws-path"] || "/";
const host = proxy["ws-headers"].Host;
config += `,ws=true${path ? ",ws-path=" + path : ""}${host ? ",ws-headers=HOST:" + host : ""
}`;
const wsHeaders = Object.entries(proxy["ws-headers"]).map(
([key, value]) => (`${key}:"${value}"`))
.join('|');
config += `,ws=true${path ? ",ws-path=" + path : ""}${wsHeaders ? ",ws-headers=" + wsHeaders : ""}`;
}
if (proxy.tls) {
config += `${typeof proxy["skip-cert-verify"] !== "undefined"

File diff suppressed because one or more lines are too long