支持v2rayN等使用的trojan链接格式
This commit is contained in:
enximi 2023-10-03 18:22:48 +08:00 committed by GitHub
parent a7e441a2fe
commit 0ba0cdd18e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -759,6 +759,15 @@ void explodeTrojan(std::string trojan, Proxy &node)
path = getUrlArg(addition, "wspath");
network = "ws";
}
// support the trojan link format used by v2ryaN and X-ui.
// format: trojan://{password}@{server}:{port}?type=ws&security=tls&path={path (urlencoded)}&sni={host}#{name}
else if(getUrlArg(addition, "type") == "ws")
{
path = getUrlArg(addition, "path");
if(path.substr(0, 3) == "%2F")
path = urlDecode(path);
network = "ws";
}
if(remark.empty())
remark = server + ":" + port;