Skip to content

Commit

Permalink
Fix #569 #448 #431 (#637)
Browse files Browse the repository at this point in the history
支持v2rayN等使用的trojan链接格式
  • Loading branch information
enximi authored Oct 3, 2023
1 parent a7e441a commit 0ba0cdd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/parser/subparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0ba0cdd

Please sign in to comment.