mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
fix: fix grpc transport
This commit is contained in:
parent
8393bddf79
commit
195826f887
@ -476,6 +476,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="8" column="0">
|
||||||
|
<widget class="QLabel" name="service_name_l">
|
||||||
|
<property name="text">
|
||||||
|
<string>Service Name</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="1">
|
||||||
|
<widget class="MyLineEdit" name="service_name"/>
|
||||||
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="MyLineEdit" name="ws_early_data_name"/>
|
<widget class="MyLineEdit" name="ws_early_data_name"/>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@ -126,10 +126,7 @@ namespace Configs {
|
|||||||
QJsonObject object;
|
QJsonObject object;
|
||||||
if (type.isEmpty() || type == "tcp") return object;
|
if (type.isEmpty() || type == "tcp") return object;
|
||||||
if (!type.isEmpty()) object["type"] = type;
|
if (!type.isEmpty()) object["type"] = type;
|
||||||
if (!path.isEmpty()) {
|
if (!path.isEmpty()) object["path"] = path;
|
||||||
if (type == "grpc") object["service_name"] = path;
|
|
||||||
else object["path"] = path;
|
|
||||||
}
|
|
||||||
if (!method.isEmpty()) object["method"] = method;
|
if (!method.isEmpty()) object["method"] = method;
|
||||||
if (!headers.isEmpty()) {
|
if (!headers.isEmpty()) {
|
||||||
object["headers"] = qStringListToJsonObject(headers);
|
object["headers"] = qStringListToJsonObject(headers);
|
||||||
|
|||||||
@ -44,8 +44,8 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId,
|
|||||||
ui->headers_l->setVisible(false);
|
ui->headers_l->setVisible(false);
|
||||||
ui->method->setVisible(false);
|
ui->method->setVisible(false);
|
||||||
ui->method_l->setVisible(false);
|
ui->method_l->setVisible(false);
|
||||||
ui->path->setVisible(true);
|
ui->path->setVisible(false);
|
||||||
ui->path_l->setVisible(true);
|
ui->path_l->setVisible(false);
|
||||||
ui->host->setVisible(false);
|
ui->host->setVisible(false);
|
||||||
ui->host_l->setVisible(false);
|
ui->host_l->setVisible(false);
|
||||||
} else if (txt == "ws" || txt == "httpupgrade") {
|
} else if (txt == "ws" || txt == "httpupgrade") {
|
||||||
@ -76,6 +76,13 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId,
|
|||||||
ui->host->setVisible(false);
|
ui->host->setVisible(false);
|
||||||
ui->host_l->setVisible(false);
|
ui->host_l->setVisible(false);
|
||||||
}
|
}
|
||||||
|
if (txt == "grpc") {
|
||||||
|
ui->service_name->setVisible(true);
|
||||||
|
ui->service_name_l->setVisible(true);
|
||||||
|
} else {
|
||||||
|
ui->service_name->setVisible(false);
|
||||||
|
ui->service_name_l->setVisible(false);
|
||||||
|
}
|
||||||
if (txt == "ws") {
|
if (txt == "ws") {
|
||||||
ui->ws_early_data_length->setVisible(true);
|
ui->ws_early_data_length->setVisible(true);
|
||||||
ui->ws_early_data_length_l->setVisible(true);
|
ui->ws_early_data_length_l->setVisible(true);
|
||||||
@ -307,6 +314,7 @@ void DialogEditProfile::typeSelected(const QString &newType) {
|
|||||||
ui->tls_rec_frag->setChecked(tls->record_fragment);
|
ui->tls_rec_frag->setChecked(tls->record_fragment);
|
||||||
ui->insecure->setChecked(tls->insecure);
|
ui->insecure->setChecked(tls->insecure);
|
||||||
ui->headers->setText(transport->getHeadersString());
|
ui->headers->setText(transport->getHeadersString());
|
||||||
|
ui->service_name->setText(transport->service_name);
|
||||||
ui->ws_early_data_name->setText(transport->early_data_header_name);
|
ui->ws_early_data_name->setText(transport->early_data_header_name);
|
||||||
ui->ws_early_data_length->setText(Int2String(transport->max_early_data));
|
ui->ws_early_data_length->setText(Int2String(transport->max_early_data));
|
||||||
ui->reality_pbk->setText(tls->reality->public_key);
|
ui->reality_pbk->setText(tls->reality->public_key);
|
||||||
@ -424,6 +432,7 @@ bool DialogEditProfile::onEnd() {
|
|||||||
tls->insecure = ui->insecure->isChecked();
|
tls->insecure = ui->insecure->isChecked();
|
||||||
transport->headers = transport->getHeaderPairs(ui->headers->text());
|
transport->headers = transport->getHeaderPairs(ui->headers->text());
|
||||||
transport->method = ui->method->text();
|
transport->method = ui->method->text();
|
||||||
|
transport->service_name = ui->service_name->text();
|
||||||
transport->early_data_header_name = ui->ws_early_data_name->text();
|
transport->early_data_header_name = ui->ws_early_data_name->text();
|
||||||
transport->max_early_data = ui->ws_early_data_length->text().toInt();
|
transport->max_early_data = ui->ws_early_data_length->text().toInt();
|
||||||
tls->reality->public_key = ui->reality_pbk->text();
|
tls->reality->public_key = ui->reality_pbk->text();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user