mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2026-04-01 00:43:20 +08:00
feat: Trojan URI 支持省略端口号
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user