Skip to content

Commit

Permalink
fix: 修复 SS URI 解析
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Dec 8, 2024
1 parent 4713b63 commit d015c78
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.14.437",
"version": "2.14.438",
"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 @@ -46,7 +46,9 @@ function URI_SS() {
content = content.split('#')[0]; // strip proxy name
// handle IPV4 and IPV6
let serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
let userInfoStr = Base64.decode(content.split('@')[0]);
let userInfoStr = Base64.decode(
decodeURIComponent(content.split('@')[0]),
);
let query = '';
if (!serverAndPortArray) {
if (content.includes('?')) {
Expand Down Expand Up @@ -77,7 +79,6 @@ function URI_SS() {
proxy.port = `${serverAndPort.substring(portIdx + 1)}`.match(
/\d+/,
)?.[0];

const userInfo = userInfoStr.match(/(^.*?):(.*$)/);
proxy.cipher = userInfo[1];
proxy.password = userInfo[2];
Expand Down

0 comments on commit d015c78

Please sign in to comment.