Skip to content

Commit

Permalink
fix: 兼容不规范的 VLESS URI
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Feb 17, 2024
1 parent c3e5da7 commit c585785
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 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.221",
"version": "2.14.222",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
18 changes: 14 additions & 4 deletions backend/src/core/proxy-utils/parsers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,17 @@ function URI_VMess() {
params.port = port;
params.add = server;
}
const server = params.add;
const port = parseInt(getIfPresent(params.port), 10);
const proxy = {
name: params.ps ?? params.remarks,
name:
params.ps ??
params.remarks ??
params.remark ??
`VMess ${server}:${port}`,
type: 'vmess',
server: params.add,
port: parseInt(getIfPresent(params.port), 10),
server,
port,
cipher: getIfPresent(params.scy, 'auto'),
uuid: params.id,
alterId: parseInt(
Expand Down Expand Up @@ -399,7 +405,11 @@ function URI_VLESS() {
params[key] = value;
}

proxy.name = name ?? params.remarks ?? `VLESS ${server}:${port}`;
proxy.name =
name ??
params.remarks ??
params.remark ??
`VLESS ${server}:${port}`;

proxy.tls = params.security && params.security !== 'none';
if (isShadowrocket && /TRUE|1/i.test(params.tls)) {
Expand Down

0 comments on commit c585785

Please sign in to comment.