Feat: Add support for httpupgrade transport

This commit is contained in:
Misaka-blog
2023-11-02 15:42:48 +08:00
parent 32ef100cf3
commit 7538075112
7 changed files with 19 additions and 5 deletions

View File

@@ -28,6 +28,9 @@ namespace NekoGui_fmt {
if (!host.isEmpty()) transport["host"] = QList2QJsonArray(host.split(","));
} else if (network == "grpc") {
if (!path.isEmpty()) transport["service_name"] = path;
} else if (network == "httpupgrade") {
if (!path.isEmpty()) transport["path"] = path;
if (!host.isEmpty()) transport["host"] = host;
}
outbound->insert("transport", transport);
} else if (header_type == "http") {

View File

@@ -51,7 +51,7 @@ namespace NekoGui_fmt {
// type
query.addQueryItem("type", stream->network);
if (stream->network == "ws" || stream->network == "http") {
if (stream->network == "ws" || stream->network == "http" || stream->network == "httpupgrade") {
if (!stream->path.isEmpty()) query.addQueryItem("path", stream->path);
if (!stream->host.isEmpty()) query.addQueryItem("host", stream->host);
} else if (stream->network == "grpc") {
@@ -152,7 +152,7 @@ namespace NekoGui_fmt {
// type
query.addQueryItem("type", stream->network);
if (stream->network == "ws" || stream->network == "http") {
if (stream->network == "ws" || stream->network == "http" || stream->network == "httpupgrade") {
if (!stream->path.isEmpty()) query.addQueryItem("path", stream->path);
if (!stream->host.isEmpty()) query.addQueryItem("host", stream->host);
} else if (stream->network == "grpc") {

View File

@@ -81,6 +81,9 @@ namespace NekoGui_fmt {
} else if (stream->network == "http") {
stream->path = GetQueryValue(query, "path", "");
stream->host = GetQueryValue(query, "host", "").replace("|", ",");
} else if (stream->network == "httpupgrade") {
stream->path = GetQueryValue(query, "path", "");
stream->host = GetQueryValue(query, "host", "");
} else if (stream->network == "grpc") {
stream->path = GetQueryValue(query, "serviceName", "");
} else if (stream->network == "tcp") {
@@ -199,6 +202,9 @@ namespace NekoGui_fmt {
} else if (stream->network == "http") {
stream->path = GetQueryValue(query, "path", "");
stream->host = GetQueryValue(query, "host", "").replace("|", ",");
} else if (stream->network == "httpupgrade") {
stream->path = GetQueryValue(query, "path", "");
stream->host = GetQueryValue(query, "host", "");
} else if (stream->network == "grpc") {
stream->path = GetQueryValue(query, "serviceName", "");
} else if (stream->network == "tcp") {

View File

@@ -8,7 +8,7 @@ namespace NekoGui_fmt {
QString network = "tcp";
QString security = "";
QString packet_encoding = "";
// ws/http/grpc/tcp-http
// ws/http/grpc/tcp-http/httpupgrade
QString path = "";
QString host = "";
// kcp/quic/tcp-http

View File

@@ -1,5 +1,5 @@
if [ ! -z $ENV_NEKORAY ]; then
export COMMIT_SING_BOX_EXTRA="2f8e1bdb842ec2138c1699101a84950617c3cbb8"
export COMMIT_SING_BOX_EXTRA="b13bae46e9fcd330c26e66caedf5640ba31f4505"
export COMMIT_MATSURI_XRAY="01208225ee7e508044cca8eb6776a117bcecd997"
fi

View File

@@ -46,7 +46,7 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId,
ui->path_l->setVisible(true);
ui->host->setVisible(false);
ui->host_l->setVisible(false);
} else if (txt == "ws" || txt == "http") {
} else if (txt == "ws" || txt == "http" || txt == "httpupgrade") {
ui->header_type->setVisible(false);
ui->header_type_l->setVisible(false);
ui->path->setVisible(true);

View File

@@ -260,6 +260,11 @@
<string notr="true">quic</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">httpupgrade</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1">