Skip to content

Commit

Permalink
fix: unknown transport type: h2 in vmess protocol (#1062)
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardZorn authored Nov 25, 2023
1 parent 205caef commit 5bf3935
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions fmt/Link2Bean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ namespace NekoGui_fmt {
stream->sni = objN["sni"].toString();
stream->header_type = objN["type"].toString();
auto net = objN["net"].toString();
if (!net.isEmpty()) stream->network = net;
if (!net.isEmpty()) {
if (net == "h2") {
net = "http";
}
stream->network = net;
}
auto scy = objN["scy"].toString();
if (!scy.isEmpty()) security = scy;
// TLS (XTLS?)
Expand All @@ -186,7 +191,11 @@ namespace NekoGui_fmt {
security = GetQueryValue(query, "encryption", "auto");

// security
stream->network = GetQueryValue(query, "type", "tcp");
auto type = GetQueryValue(query, "type", "tcp");
if (type == "h2") {
type = "http";
}
stream->network = type;
stream->security = GetQueryValue(query, "security", "tls").replace("reality", "tls");
auto sni1 = GetQueryValue(query, "sni");
auto sni2 = GetQueryValue(query, "peer");
Expand Down

0 comments on commit 5bf3935

Please sign in to comment.