diff --git a/backend/package.json b/backend/package.json index 4f13f67ac..0c8fb8b2c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.428", + "version": "2.14.429", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/parsers/index.js b/backend/src/core/proxy-utils/parsers/index.js index 070089836..55e03b3e4 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -842,6 +842,11 @@ function URI_Trojan() { }; const parse = (line) => { + const matched = /^(trojan:\/\/.*?@.*?)(:(\d+))?\/?(\?.*?)?$/.exec(line); + const port = matched?.[2]; + if (!port) { + line = line.replace(matched[1], `${matched[1]}:443`); + } let [newLine, name] = line.split(/#(.+)/, 2); const parser = getTrojanURIParser(); const proxy = parser.parse(newLine);