mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 03:29:03 +08:00
修复端口非443的Troajn节点无法解析的问题
This commit is contained in:
parent
1f66e110ab
commit
76cd097a23
@ -1191,19 +1191,15 @@ var ProxyUtils = (function () {
|
|||||||
|
|
||||||
const parse = (line) => {
|
const parse = (line) => {
|
||||||
const supported = {};
|
const supported = {};
|
||||||
// trojan forces to use 443 port
|
|
||||||
if (line.indexOf(":443") === -1) {
|
|
||||||
throw new Error("Trojan port should always be 443!");
|
|
||||||
}
|
|
||||||
line = line.split("trojan://")[1];
|
line = line.split("trojan://")[1];
|
||||||
const server = line.split("@")[1].split(":443")[0];
|
const [server, port] = line.split("@")[1].split("?")[0].split(".");
|
||||||
const name = decodeURIComponent(line.split("#")[1].trim());
|
const name = decodeURIComponent(line.split("#")[1].trim());
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: name || `[Trojan] ${server}`, // trojan uri may have no server tag!
|
name: name || `[Trojan] ${server}`, // trojan uri may have no server tag!
|
||||||
type: "trojan",
|
type: "trojan",
|
||||||
server,
|
server,
|
||||||
port: 443,
|
port,
|
||||||
password: line.split("@")[0],
|
password: line.split("@")[0],
|
||||||
supported,
|
supported,
|
||||||
};
|
};
|
||||||
|
4
backend/sub-store.min.js
vendored
4
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user