feat: 兼容不规范的 VLESS URI

This commit is contained in:
xream 2024-01-18 01:17:06 +08:00
parent 88e52f9787
commit 9bb06bf438
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 8 additions and 3 deletions

View File

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

View File

@ -409,8 +409,10 @@ function URI_VLESS() {
proxy[`${params.security}-opts`] = opts;
}
}
proxy.network = params.type;
if (proxy.network === 'tcp' && params.headerType === 'http') {
proxy.network = 'http';
}
if (!proxy.network && isShadowrocket && params.obfs) {
proxy.network = params.obfs;
}
@ -915,7 +917,8 @@ function Surge_External() {
line,
)?.[2];
}
// args = "-m", args = "rc4-md5"
// args = -m, args = rc4-md5
const argsRegex = /(,|^)\s*?args\s*?=\s*("(.*?)"|(.*?))(?=\s*?(,|$))/g;
let argsMatch;
const args = [];
@ -926,6 +929,8 @@ function Surge_External() {
args.push(argsMatch[4]);
}
}
// addresses = "[ipv6]",,addresses = "ipv6", addresses = "ipv4"
// addresses = [ipv6], addresses = ipv6, addresses = ipv4
const addressesRegex =
/(,|^)\s*?addresses\s*?=\s*("(.*?)"|(.*?))(?=\s*?(,|$))/g;
let addressesMatch;