mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
fix: v2ray http header
This commit is contained in:
@@ -36,6 +36,15 @@ namespace NekoRay::fmt {
|
||||
if (!path.isEmpty()) quic["key"] = path;
|
||||
if (!host.isEmpty()) quic["security"] = host;
|
||||
streamSettings["quicSettings"] = quic;
|
||||
} else if (network == "tcp" && !header_type.isEmpty()) {
|
||||
QJsonObject header{{"type", header_type}};
|
||||
if (header_type == "http") {
|
||||
header["request"] = QJsonObject{
|
||||
{"path", QList2QJsonArray(path.split(","))},
|
||||
{"headers", QJsonObject{{"Host", QList2QJsonArray(host.split(","))}}},
|
||||
};
|
||||
}
|
||||
streamSettings["tcpSettings"] = QJsonObject{{"header", header}};
|
||||
}
|
||||
|
||||
if (security == "tls") {
|
||||
@@ -56,18 +65,6 @@ namespace NekoRay::fmt {
|
||||
streamSettings["security"] = "tls";
|
||||
}
|
||||
|
||||
if (!header_type.isEmpty()) {
|
||||
QJsonObject header{{"type", header_type}};
|
||||
if (header_type == "http") {
|
||||
QJsonObject request{
|
||||
{"path", QList2QJsonArray(path.split(","))},
|
||||
{"headers", QJsonObject{{"Host", QList2QJsonArray(host.split(","))}}},
|
||||
};
|
||||
header["request"] = request;
|
||||
}
|
||||
streamSettings["header"] = header;
|
||||
}
|
||||
|
||||
return streamSettings;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user