mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
Support hysteria2
This commit is contained in:
@@ -120,8 +120,8 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId,
|
||||
LOAD_TYPE("vmess")
|
||||
LOAD_TYPE("vless")
|
||||
LOAD_TYPE("naive")
|
||||
LOAD_TYPE("hysteria")
|
||||
LOAD_TYPE("hysteria2")
|
||||
ui->type->addItem("Hysteria1", "hysteria");
|
||||
ui->type->addItem("Hysteria2", "hysteria2");
|
||||
LOAD_TYPE("tuic")
|
||||
ui->type->addItem(tr("Custom (%1 outbound)").arg(software_core_name), "internal");
|
||||
ui->type->addItem(tr("Custom (%1 config)").arg(software_core_name), "internal-full");
|
||||
|
||||
@@ -29,6 +29,7 @@ void EditQUIC::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
P_LOAD_STRING(authPayload);
|
||||
P_LOAD_INT(streamReceiveWindow);
|
||||
P_LOAD_INT(connectionReceiveWindow);
|
||||
P_LOAD_BOOL(forceExternal);
|
||||
|
||||
ui->uuid->hide();
|
||||
ui->uuid_l->hide();
|
||||
@@ -43,20 +44,39 @@ void EditQUIC::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
ui->heartbeat->hide();
|
||||
ui->heartbeat_l->hide();
|
||||
ui->uos->hide();
|
||||
if (!IS_NEKO_BOX) ui->forceExternal->hide();
|
||||
|
||||
if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria) {
|
||||
if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria) { // hy1
|
||||
P_LOAD_COMBO_INT(hyProtocol);
|
||||
P_LOAD_COMBO_INT(authPayloadType);
|
||||
|
||||
ui->username_l->hide();
|
||||
ui->username->hide();
|
||||
} else {
|
||||
} else { // hy2
|
||||
P_LOAD_STRING(username);
|
||||
|
||||
ui->hyProtocol->hide();
|
||||
ui->hyProtocol_l->hide();
|
||||
ui->hyProtocol->hide();
|
||||
ui->hyProtocol_l->hide();
|
||||
ui->authPayload->hide();
|
||||
ui->authPayload_l->hide();
|
||||
ui->authPayloadType->hide();
|
||||
ui->authPayloadType_l->hide();
|
||||
ui->alpn->hide();
|
||||
ui->alpn_l->hide();
|
||||
ui->TLS->removeItem(ui->alpn_sp);
|
||||
if (IS_NEKO_BOX) {
|
||||
ui->disableMtuDiscovery->hide();
|
||||
ui->hopInterval->hide();
|
||||
ui->hopInterval_l->hide();
|
||||
ui->hopPort->hide();
|
||||
ui->hopPort_l->hide();
|
||||
ui->connectionReceiveWindow->hide();
|
||||
ui->connectionReceiveWindow_l->hide();
|
||||
ui->streamReceiveWindow->hide();
|
||||
ui->streamReceiveWindow_l->hide();
|
||||
}
|
||||
}
|
||||
} else if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_TUIC) {
|
||||
P_LOAD_STRING(uuid);
|
||||
@@ -104,6 +124,8 @@ void EditQUIC::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
bool EditQUIC::onEnd() {
|
||||
auto bean = this->ent->QUICBean();
|
||||
|
||||
P_SAVE_BOOL(forceExternal);
|
||||
|
||||
// Hysteria
|
||||
P_SAVE_STRING(hopPort);
|
||||
P_SAVE_INT(hopInterval);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>600</height>
|
||||
<height>628</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -157,8 +157,18 @@
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="uos">
|
||||
<property name="toolTip">
|
||||
<string notr="true">Requires sing-box server</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>UDP over Stream</string>
|
||||
<string notr="true">UDP over Stream</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="forceExternal">
|
||||
<property name="text">
|
||||
<string>Force use external core</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -358,15 +368,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="sni_l">
|
||||
<property name="text">
|
||||
<string>SNI</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QCheckBox" name="allowInsecure">
|
||||
<property name="text">
|
||||
<string>Allow Insecure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<item row="1" column="2">
|
||||
<spacer name="alpn_sp">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@@ -381,13 +398,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="sni_l">
|
||||
<property name="text">
|
||||
<string>SNI</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@@ -432,8 +442,11 @@
|
||||
<tabstop>udpRelayMode</tabstop>
|
||||
<tabstop>heartbeat</tabstop>
|
||||
<tabstop>zeroRttHandshake</tabstop>
|
||||
<tabstop>forceExternal</tabstop>
|
||||
<tabstop>uos</tabstop>
|
||||
<tabstop>hyProtocol</tabstop>
|
||||
<tabstop>disableMtuDiscovery</tabstop>
|
||||
<tabstop>username</tabstop>
|
||||
<tabstop>obfsPassword</tabstop>
|
||||
<tabstop>authPayloadType</tabstop>
|
||||
<tabstop>authPayload</tabstop>
|
||||
@@ -443,8 +456,8 @@
|
||||
<tabstop>sni</tabstop>
|
||||
<tabstop>disableSni</tabstop>
|
||||
<tabstop>alpn</tabstop>
|
||||
<tabstop>allowInsecure</tabstop>
|
||||
<tabstop>certificate</tabstop>
|
||||
<tabstop>allowInsecure</tabstop>
|
||||
<tabstop>streamReceiveWindow</tabstop>
|
||||
<tabstop>connectionReceiveWindow</tabstop>
|
||||
</tabstops>
|
||||
|
||||
Reference in New Issue
Block a user