Skip to content

Commit

Permalink
feat: 兼容不规范的 VLESS URI
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 17, 2024
1 parent 88e52f9 commit 9bb06bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
9 changes: 7 additions & 2 deletions backend/src/core/proxy-utils/parsers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 = [];
Expand All @@ -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;
Expand Down

0 comments on commit 9bb06bf

Please sign in to comment.