fix: unknown transport type: h2 in vmess protocol (#1062)

This commit is contained in:
Fw[a]rd 2023-11-25 18:44:21 +08:00 committed by GitHub
parent 205caef7a5
commit 5bf393597e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,7 +163,12 @@ namespace NekoGui_fmt {
stream->sni = objN["sni"].toString(); stream->sni = objN["sni"].toString();
stream->header_type = objN["type"].toString(); stream->header_type = objN["type"].toString();
auto net = objN["net"].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(); auto scy = objN["scy"].toString();
if (!scy.isEmpty()) security = scy; if (!scy.isEmpty()) security = scy;
// TLS (XTLS?) // TLS (XTLS?)
@ -186,7 +191,11 @@ namespace NekoGui_fmt {
security = GetQueryValue(query, "encryption", "auto"); security = GetQueryValue(query, "encryption", "auto");
// security // 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"); stream->security = GetQueryValue(query, "security", "tls").replace("reality", "tls");
auto sni1 = GetQueryValue(query, "sni"); auto sni1 = GetQueryValue(query, "sni");
auto sni2 = GetQueryValue(query, "peer"); auto sni2 = GetQueryValue(query, "peer");