Skip to content

Commit

Permalink
fix: 修复 Shadowsocks URI 解析
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Feb 12, 2025
1 parent 71fc9af commit 5e2a87e
Show file tree
Hide file tree
Showing 2 changed files with 4 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.16.38",
"version": "2.16.39",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions backend/src/core/proxy-utils/parsers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function URI_SS() {
query = parsed[2];
}
content = Base64.decode(content);

if (query) {
if (/(&|\?)v2ray-plugin=/.test(query)) {
const parsed = query.match(/(&|\?)v2ray-plugin=(.*?)(&|$)/);
Expand All @@ -165,8 +166,8 @@ function URI_SS() {
}
content = `${content}${query}`;
}
userInfoStr = content.split('@')[0];
serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
userInfoStr = content.match(/(^.*)@/)?.[1];
serverAndPortArray = content.match(/@([^/@]*)(\/|$)/);
} else if (content.includes('?')) {
const parsed = content.match(/(\?.*)$/);
query = parsed[1];
Expand Down

0 comments on commit 5e2a87e

Please sign in to comment.