mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-16 02:37:19 +08:00
feat: Trojan URI 支持省略端口号
This commit is contained in:
parent
6aece471aa
commit
9d90369594
@ -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": {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user