From f6cf1414bf2c9092f7fdbf6022eea6cb7f782447 Mon Sep 17 00:00:00 2001
From: armv9 <48624112+arm64v8a@users.noreply.github.com>
Date: Fri, 5 Jul 2024 10:29:22 +0900
Subject: [PATCH] hysteria -> hysteria2
---
README.md | 1 -
db/Database.cpp | 2 -
fmt/Bean2CoreObj_box.cpp | 19 +--
fmt/Bean2External.cpp | 95 ++----------
fmt/Bean2Link.cpp | 24 +--
fmt/Link2Bean.cpp | 34 +----
fmt/QUICBean.hpp | 39 +----
sub/GroupUpdater.cpp | 39 -----
translations/fa_IR.ts | 12 --
translations/ru_RU.ts | 12 --
translations/zh_CN.ts | 20 ---
ui/dialog_basic_settings.cpp | 1 -
ui/edit/dialog_edit_profile.cpp | 3 +-
ui/edit/edit_custom.cpp | 1 -
ui/edit/edit_quic.cpp | 45 ++----
ui/edit/edit_quic.ui | 251 +++++++++++---------------------
16 files changed, 119 insertions(+), 479 deletions(-)
diff --git a/README.md b/README.md
index 64e2dab..e650503 100644
--- a/README.md
+++ b/README.md
@@ -64,7 +64,6 @@ https://matsuridayo.github.io
- Trojan
- TUIC ( sing-box )
- NaïveProxy ( Custom Core )
-- Hysteria ( Custom Core or sing-box )
- Hysteria2 ( Custom Core or sing-box )
- Custom Outbound
- Custom Config
diff --git a/db/Database.cpp b/db/Database.cpp
index d99741f..84e69df 100644
--- a/db/Database.cpp
+++ b/db/Database.cpp
@@ -184,8 +184,6 @@ namespace NekoGui {
bean = new NekoGui_fmt::TrojanVLESSBean(NekoGui_fmt::TrojanVLESSBean::proxy_VLESS);
} else if (type == "naive") {
bean = new NekoGui_fmt::NaiveBean();
- } else if (type == "hysteria") {
- bean = new NekoGui_fmt::QUICBean(NekoGui_fmt::QUICBean::proxy_Hysteria);
} else if (type == "hysteria2") {
bean = new NekoGui_fmt::QUICBean(NekoGui_fmt::QUICBean::proxy_Hysteria2);
} else if (type == "tuic") {
diff --git a/fmt/Bean2CoreObj_box.cpp b/fmt/Bean2CoreObj_box.cpp
index e8307c5..72b6e1e 100644
--- a/fmt/Bean2CoreObj_box.cpp
+++ b/fmt/Bean2CoreObj_box.cpp
@@ -191,27 +191,12 @@ namespace NekoGui_fmt {
{"tls", coreTlsObj},
};
- if (proxy_type == proxy_Hysteria) {
- outbound["type"] = "hysteria";
- outbound["obfs"] = obfsPassword;
- outbound["disable_mtu_discovery"] = disableMtuDiscovery;
- outbound["recv_window"] = streamReceiveWindow;
- outbound["recv_window_conn"] = connectionReceiveWindow;
- outbound["up_mbps"] = uploadMbps;
- outbound["down_mbps"] = downloadMbps;
-
- if (!hopPort.trimmed().isEmpty()) {
- outbound["hop_ports"] = hopPort;
- outbound["hop_interval"] = hopInterval;
- }
- if (authPayloadType == hysteria_auth_base64) outbound["auth"] = authPayload;
- if (authPayloadType == hysteria_auth_string) outbound["auth_str"] = authPayload;
- } else if (proxy_type == proxy_Hysteria2) {
+ if (proxy_type == proxy_Hysteria2) {
outbound["type"] = "hysteria2";
outbound["password"] = password;
outbound["up_mbps"] = uploadMbps;
outbound["down_mbps"] = downloadMbps;
-
+
if (!hopPort.trimmed().isEmpty()) {
outbound["hop_ports"] = hopPort;
outbound["hop_interval"] = hopInterval;
diff --git a/fmt/Bean2External.cpp b/fmt/Bean2External.cpp
index 50de4ef..caca35d 100644
--- a/fmt/Bean2External.cpp
+++ b/fmt/Bean2External.cpp
@@ -36,46 +36,26 @@ namespace NekoGui_fmt {
}
int QUICBean::NeedExternal(bool isFirstProfile) {
- auto hysteriaCore = [=] {
+ auto extCore = [=] {
if (isFirstProfile) {
- if (NekoGui::dataStore->spmode_vpn && hyProtocol != hysteria_protocol_facktcp && hopPort.trimmed().isEmpty()) {
+ if (NekoGui::dataStore->spmode_vpn && hopPort.trimmed().isEmpty()) {
return 1;
}
return 2;
} else {
- if (hyProtocol == hysteria_protocol_facktcp || !hopPort.trimmed().isEmpty()) {
+ if (!hopPort.trimmed().isEmpty()) {
return -1;
}
}
return 1;
};
- auto hysteria2Core = [=] {
- if (isFirstProfile) {
- if (NekoGui::dataStore->spmode_vpn) {
- return 1;
- }
- return 2;
- }
- return 1;
- };
-
- auto tuicCore = [=] {
- if (isFirstProfile) {
- if (NekoGui::dataStore->spmode_vpn) {
- return 1;
- }
- return 2;
- }
- return 1;
- };
-
- if (!forceExternal && (proxy_type == proxy_TUIC || hyProtocol == hysteria_protocol_udp)) {
+ if (!forceExternal && (proxy_type == proxy_TUIC || hopPort.trimmed().isEmpty())) {
// sing-box support
return 0;
} else {
- // hysteria core support
- return hysteriaCore();
+ // external core support
+ return extCore();
}
}
@@ -233,68 +213,11 @@ namespace NekoGui_fmt {
WriteTempFile("hysteria2_" + GetRandomString(10) + ".json", result.config_export.toUtf8());
result.arguments = QStringList{"-c", TempFile};
- return result;
-
- } else { // Hysteria
- ExternalBuildResult result{NekoGui::dataStore->extraCore->Get("hysteria")};
-
- QJsonObject config;
-
- // determine server format
- auto is_direct = external_stat == 2;
- auto sniGen = sni;
- if (sni.isEmpty() && !IsIpAddress(serverAddress)) sniGen = serverAddress;
-
- auto server = serverAddress;
- if (!hopPort.trimmed().isEmpty()) {
- server = WrapIPV6Host(server) + ":" + hopPort;
- } else {
- server = WrapIPV6Host(server) + ":" + Int2String(serverPort);
- }
- config["server"] = is_direct ? server : "127.0.0.1:" + Int2String(mapping_port);
-
- // listen
- config["socks5"] = QJsonObject{
- {"listen", "127.0.0.1:" + Int2String(socks_port)},
- };
-
- // misc
-
- config["retry"] = 5;
- config["fast_open"] = true;
- config["lazy_start"] = true;
- config["obfs"] = obfsPassword;
- config["up_mbps"] = uploadMbps;
- config["down_mbps"] = downloadMbps;
-
- if (authPayloadType == hysteria_auth_base64) config["auth"] = authPayload;
- if (authPayloadType == hysteria_auth_string) config["auth_str"] = authPayload;
-
- if (hyProtocol == hysteria_protocol_facktcp) config["protocol"] = "faketcp";
- if (hyProtocol == hysteria_protocol_wechat_video) config["protocol"] = "wechat-video";
-
- if (!sniGen.isEmpty()) config["server_name"] = sniGen;
- if (!alpn.isEmpty()) config["alpn"] = alpn;
-
- if (!caText.trimmed().isEmpty()) {
- WriteTempFile("hysteria_" + GetRandomString(10) + ".crt", caText.toUtf8());
- config["ca"] = TempFile;
- }
-
- if (allowInsecure) config["insecure"] = true;
- if (streamReceiveWindow > 0) config["recv_window_conn"] = streamReceiveWindow;
- if (connectionReceiveWindow > 0) config["recv_window"] = connectionReceiveWindow;
- if (disableMtuDiscovery) config["disable_mtu_discovery"] = true;
- config["hop_interval"] = hopInterval;
-
- //
-
- result.config_export = QJsonObject2QString(config, false);
- WriteTempFile("hysteria_" + GetRandomString(10) + ".json", result.config_export.toUtf8());
- result.arguments = QStringList{"--no-check", "-c", TempFile};
-
return result;
}
+ ExternalBuildResult e;
+ e.error = "unknown type";
+ return e;
}
ExternalBuildResult CustomBean::BuildExternal(int mapping_port, int socks_port, int external_stat) {
diff --git a/fmt/Bean2Link.cpp b/fmt/Bean2Link.cpp
index 78e8415..1381690 100644
--- a/fmt/Bean2Link.cpp
+++ b/fmt/Bean2Link.cpp
@@ -182,29 +182,7 @@ namespace NekoGui_fmt {
QString QUICBean::ToShareLink() {
QUrl url;
- if (proxy_type == proxy_Hysteria) {
- url.setScheme("hysteria");
- url.setHost(serverAddress);
- url.setPort(serverPort);
- QUrlQuery q;
- q.addQueryItem("upmbps", Int2String(uploadMbps));
- q.addQueryItem("downmbps", Int2String(downloadMbps));
- if (!obfsPassword.isEmpty()) {
- q.addQueryItem("obfs", "xplus");
- q.addQueryItem("obfsParam", obfsPassword);
- }
- if (authPayloadType == hysteria_auth_string) q.addQueryItem("auth", authPayload);
- if (hyProtocol == hysteria_protocol_facktcp) q.addQueryItem("protocol", "faketcp");
- if (hyProtocol == hysteria_protocol_wechat_video) q.addQueryItem("protocol", "wechat-video");
- if (!hopPort.trimmed().isEmpty()) q.addQueryItem("mport", hopPort);
- if (allowInsecure) q.addQueryItem("insecure", "1");
- if (!sni.isEmpty()) q.addQueryItem("peer", sni);
- if (!alpn.isEmpty()) q.addQueryItem("alpn", alpn);
- if (connectionReceiveWindow > 0) q.addQueryItem("recv_window", Int2String(connectionReceiveWindow));
- if (streamReceiveWindow > 0) q.addQueryItem("recv_window_conn", Int2String(streamReceiveWindow));
- if (!q.isEmpty()) url.setQuery(q);
- if (!name.isEmpty()) url.setFragment(name);
- } else if (proxy_type == proxy_TUIC) {
+ if (proxy_type == proxy_TUIC) {
url.setScheme("tuic");
url.setUserName(uuid);
url.setPassword(password);
diff --git a/fmt/Link2Bean.cpp b/fmt/Link2Bean.cpp
index 3bbd279..f5d9e0d 100644
--- a/fmt/Link2Bean.cpp
+++ b/fmt/Link2Bean.cpp
@@ -55,7 +55,7 @@ namespace NekoGui_fmt {
// security
- auto type = GetQueryValue(query, "type", "tcp");
+ auto type = GetQueryValue(query, "type", "tcp");
if (type == "h2") {
type = "http";
}
@@ -256,37 +256,7 @@ namespace NekoGui_fmt {
auto query = QUrlQuery(url.query());
if (url.host().isEmpty() || url.port() == -1) return false;
- if (url.scheme() == "hysteria") {
- // https://hysteria.network/docs/uri-scheme/
- if (!query.hasQueryItem("upmbps") || !query.hasQueryItem("downmbps")) return false;
-
- name = url.fragment(QUrl::FullyDecoded);
- serverAddress = url.host();
- serverPort = url.port();
- hopPort = query.queryItemValue("mport");
- obfsPassword = query.queryItemValue("obfsParam");
- allowInsecure = QStringList{"1", "true"}.contains(query.queryItemValue("insecure"));
- uploadMbps = query.queryItemValue("upmbps").toInt();
- downloadMbps = query.queryItemValue("downmbps").toInt();
-
- auto protocolStr = (query.hasQueryItem("protocol") ? query.queryItemValue("protocol") : "udp").toLower();
- if (protocolStr == "faketcp") {
- hyProtocol = NekoGui_fmt::QUICBean::hysteria_protocol_facktcp;
- } else if (protocolStr.startsWith("wechat")) {
- hyProtocol = NekoGui_fmt::QUICBean::hysteria_protocol_wechat_video;
- }
-
- if (query.hasQueryItem("auth")) {
- authPayload = query.queryItemValue("auth");
- authPayloadType = NekoGui_fmt::QUICBean::hysteria_auth_string;
- }
-
- alpn = query.queryItemValue("alpn");
- sni = FIRST_OR_SECOND(query.queryItemValue("peer"), query.queryItemValue("sni"));
-
- connectionReceiveWindow = query.queryItemValue("recv_window").toInt();
- streamReceiveWindow = query.queryItemValue("recv_window_conn").toInt();
- } else if (url.scheme() == "tuic") {
+ if (url.scheme() == "tuic") {
// by daeuniverse
// https://github.com/daeuniverse/dae/discussions/182
diff --git a/fmt/QUICBean.hpp b/fmt/QUICBean.hpp
index b4650ed..9a18c63 100644
--- a/fmt/QUICBean.hpp
+++ b/fmt/QUICBean.hpp
@@ -5,32 +5,19 @@
namespace NekoGui_fmt {
class QUICBean : public AbstractBean {
public:
- static constexpr int proxy_Hysteria = 0;
+ // static constexpr int proxy_Hysteria = 0;
static constexpr int proxy_TUIC = 1;
static constexpr int proxy_Hysteria2 = 3;
- int proxy_type = proxy_Hysteria;
+ int proxy_type = proxy_Hysteria2;
bool forceExternal = false;
- // Hysteria 1
-
- static constexpr int hysteria_protocol_udp = 0;
- static constexpr int hysteria_protocol_facktcp = 1;
- static constexpr int hysteria_protocol_wechat_video = 2;
- int hyProtocol = 0;
-
- static constexpr int hysteria_auth_none = 0;
- static constexpr int hysteria_auth_string = 1;
- static constexpr int hysteria_auth_base64 = 2;
- int authPayloadType = 0;
- QString authPayload = "";
-
- // Hysteria 1&2
+ // Hysteria 2
QString obfsPassword = "";
- int uploadMbps = 100;
- int downloadMbps = 100;
+ int uploadMbps = 0;
+ int downloadMbps = 0;
qint64 streamReceiveWindow = 0;
qint64 connectionReceiveWindow = 0;
@@ -62,8 +49,7 @@ namespace NekoGui_fmt {
explicit QUICBean(int _proxy_type) : AbstractBean(0) {
proxy_type = _proxy_type;
- if (proxy_type == proxy_Hysteria || proxy_type == proxy_Hysteria2) {
- _add(new configItem("authPayload", &authPayload, itemType::string));
+ if (proxy_type == proxy_Hysteria2) {
_add(new configItem("obfsPassword", &obfsPassword, itemType::string));
_add(new configItem("uploadMbps", &uploadMbps, itemType::integer));
_add(new configItem("downloadMbps", &downloadMbps, itemType::integer));
@@ -72,14 +58,7 @@ namespace NekoGui_fmt {
_add(new configItem("disableMtuDiscovery", &disableMtuDiscovery, itemType::boolean));
_add(new configItem("hopInterval", &hopInterval, itemType::integer));
_add(new configItem("hopPort", &hopPort, itemType::string));
- if (proxy_type == proxy_Hysteria) { // hy1
- _add(new configItem("authPayloadType", &authPayloadType, itemType::integer));
- _add(new configItem("protocol", &hyProtocol, itemType::integer));
- } else { // hy2
- uploadMbps = 0;
- downloadMbps = 0;
- _add(new configItem("password", &password, itemType::string));
- }
+ _add(new configItem("password", &password, itemType::string));
} else if (proxy_type == proxy_TUIC) {
_add(new configItem("uuid", &uuid, itemType::string));
_add(new configItem("password", &password, itemType::string));
@@ -108,8 +87,6 @@ namespace NekoGui_fmt {
return software_core_name;
} else if (proxy_type == proxy_TUIC) {
return "tuic";
- } else if (proxy_type == proxy_Hysteria) {
- return "hysteria";
} else {
return "hysteria2";
}
@@ -118,8 +95,6 @@ namespace NekoGui_fmt {
QString DisplayType() override {
if (proxy_type == proxy_TUIC) {
return "TUIC";
- } else if (proxy_type == proxy_Hysteria) {
- return "Hysteria1";
} else {
return "Hysteria2";
}
diff --git a/sub/GroupUpdater.cpp b/sub/GroupUpdater.cpp
index ef3b227..7d40dc2 100644
--- a/sub/GroupUpdater.cpp
+++ b/sub/GroupUpdater.cpp
@@ -122,14 +122,6 @@ namespace NekoGui_sub {
if (!ok) return;
}
- // Hysteria1
- if (str.startsWith("hysteria://")) {
- needFix = false;
- ent = NekoGui::ProfileManager::NewProxyEntity("hysteria");
- auto ok = ent->QUICBean()->TryParseLink(str);
- if (!ok) return;
- }
-
// Hysteria2
if (str.startsWith("hysteria2://") || str.startsWith("hy2://")) {
needFix = false;
@@ -413,37 +405,6 @@ namespace NekoGui_sub {
break;
}
}
- } else if (type == "hysteria") {
- auto bean = ent->QUICBean();
-
- bean->hopPort = Node2QString(proxy["ports"]);
-
- bean->allowInsecure = Node2Bool(proxy["skip-cert-verify"]);
- auto alpn = Node2QStringList(proxy["alpn"]);
- bean->caText = Node2QString(proxy["ca-str"]);
- if (!alpn.isEmpty()) bean->alpn = alpn[0];
- bean->sni = Node2QString(proxy["sni"]);
-
- auto auth_str = FIRST_OR_SECOND(Node2QString(proxy["auth_str"]), Node2QString(proxy["auth-str"]));
- auto auth = Node2QString(proxy["auth"]);
- if (!auth_str.isEmpty()) {
- bean->authPayloadType = NekoGui_fmt::QUICBean::hysteria_auth_string;
- bean->authPayload = auth_str;
- }
- if (!auth.isEmpty()) {
- bean->authPayloadType = NekoGui_fmt::QUICBean::hysteria_auth_base64;
- bean->authPayload = auth;
- }
- bean->obfsPassword = Node2QString(proxy["obfs"]);
-
- if (Node2Bool(proxy["disable_mtu_discovery"]) || Node2Bool(proxy["disable-mtu-discovery"])) bean->disableMtuDiscovery = true;
- bean->streamReceiveWindow = Node2Int(proxy["recv-window"]);
- bean->connectionReceiveWindow = Node2Int(proxy["recv-window-conn"]);
-
- auto upMbps = Node2QString(proxy["up"]).split(" ")[0].toInt();
- auto downMbps = Node2QString(proxy["down"]).split(" ")[0].toInt();
- if (upMbps > 0) bean->uploadMbps = upMbps;
- if (downMbps > 0) bean->downloadMbps = downMbps;
} else if (type == "hysteria2") {
auto bean = ent->QUICBean();
diff --git a/translations/fa_IR.ts b/translations/fa_IR.ts
index d757f54..8790d9c 100644
--- a/translations/fa_IR.ts
+++ b/translations/fa_IR.ts
@@ -857,14 +857,6 @@ This needs to be run NekoBox with administrator privileges.
Certificate
گواهی
-
- Auth Type
-
-
-
- Protocol
- پروتکل
-
Download (Mbps)
دانلود (مگابیت بر ثانیه)
@@ -897,10 +889,6 @@ This needs to be run NekoBox with administrator privileges.
SNI
-
- Auth Payload
-
-
Disable SNI
diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts
index 395e18e..c65759f 100644
--- a/translations/ru_RU.ts
+++ b/translations/ru_RU.ts
@@ -856,14 +856,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun
EditQUIC
-
- Auth Type
- Тип авторизации
-
-
- Protocol
- Протокол
-
Download (Mbps)
Скорость приема (Mbps)
@@ -900,10 +892,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun
SNI
SNI
-
- Auth Payload
- Полезная нагрузка в режиме авторизации
-
Disable SNI
Отключить SNI
diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts
index c55d4cd..491d360 100644
--- a/translations/zh_CN.ts
+++ b/translations/zh_CN.ts
@@ -861,14 +861,6 @@ This needs to be run NekoBox with administrator privileges.
Certificate
证书
-
- Auth Type
- 认证类型
-
-
- Protocol
- 协议
-
Download (Mbps)
下载速度 (Mbps)
@@ -901,10 +893,6 @@ This needs to be run NekoBox with administrator privileges.
SNI
SNI
-
- Auth Payload
- 认证有效载荷
-
Generate UUID
生成 UUID
@@ -1222,10 +1210,6 @@ This needs to be run NekoBox with administrator privileges.
Testing
正在测试
-
- Http inbound is not enabled, can't set system proxy.
- HTTP 入站未启用,无法设置系统代理。
-
Update
更新
@@ -1296,10 +1280,6 @@ End: %2
Remove Unavailable
删除不可用的配置
-
- Settings
- 设置
-
New profile
手动输入配置
diff --git a/ui/dialog_basic_settings.cpp b/ui/dialog_basic_settings.cpp
index 853fdda..e468e34 100644
--- a/ui/dialog_basic_settings.cpp
+++ b/ui/dialog_basic_settings.cpp
@@ -159,7 +159,6 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
//
CACHE.extraCore = QString2QJsonObject(NekoGui::dataStore->extraCore->core_map);
if (!CACHE.extraCore.contains("naive")) CACHE.extraCore.insert("naive", "");
- if (!CACHE.extraCore.contains("hysteria")) CACHE.extraCore.insert("hysteria", "");
if (!CACHE.extraCore.contains("hysteria2")) CACHE.extraCore.insert("hysteria2", "");
if (!CACHE.extraCore.contains("tuic")) CACHE.extraCore.insert("tuic", "");
//
diff --git a/ui/edit/dialog_edit_profile.cpp b/ui/edit/dialog_edit_profile.cpp
index bcdb481..47d3faf 100644
--- a/ui/edit/dialog_edit_profile.cpp
+++ b/ui/edit/dialog_edit_profile.cpp
@@ -114,7 +114,6 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId,
LOAD_TYPE("vmess")
LOAD_TYPE("vless")
LOAD_TYPE("naive")
- LOAD_TYPE("hysteria")
LOAD_TYPE("hysteria2")
LOAD_TYPE("tuic")
ui->type->addItem(tr("Custom (%1 outbound)").arg(software_core_name), "internal");
@@ -172,7 +171,7 @@ void DialogEditProfile::typeSelected(const QString &newType) {
auto _innerWidget = new EditNaive(this);
innerWidget = _innerWidget;
innerEditor = _innerWidget;
- } else if (type == "hysteria" || type == "hysteria2" || type == "tuic") {
+ } else if (type == "hysteria2" || type == "tuic") {
auto _innerWidget = new EditQUIC(this);
innerWidget = _innerWidget;
innerEditor = _innerWidget;
diff --git a/ui/edit/edit_custom.cpp b/ui/edit/edit_custom.cpp
index d8a669d..be7685d 100644
--- a/ui/edit/edit_custom.cpp
+++ b/ui/edit/edit_custom.cpp
@@ -40,7 +40,6 @@ void EditCustom::onStart(std::shared_ptr _ent) {
// load known core
auto core_map = QString2QJsonObject(NekoGui::dataStore->extraCore->core_map);
for (const auto &key: core_map.keys()) {
- if (key == "naive" || key == "hysteria") continue;
ui->core->addItem(key);
}
if (preset_core == "internal") {
diff --git a/ui/edit/edit_quic.cpp b/ui/edit/edit_quic.cpp
index 1c7c790..aa869ea 100644
--- a/ui/edit/edit_quic.cpp
+++ b/ui/edit/edit_quic.cpp
@@ -25,13 +25,10 @@ void EditQUIC::onStart(std::shared_ptr _ent) {
P_LOAD_INT(downloadMbps);
P_LOAD_BOOL(disableMtuDiscovery)
P_LOAD_STRING(obfsPassword);
- P_LOAD_STRING(authPayload);
P_LOAD_INT(streamReceiveWindow);
P_LOAD_INT(connectionReceiveWindow);
P_LOAD_BOOL(forceExternal);
- P_LOAD_COMBO_INT(hyProtocol);
- P_LOAD_COMBO_INT(authPayloadType);
P_LOAD_STRING(uuid);
P_LOAD_STRING(password);
@@ -48,7 +45,7 @@ void EditQUIC::onStart(std::shared_ptr _ent) {
P_LOAD_BOOL(allowInsecure);
P_LOAD_BOOL(disableSni);
- if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria || bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria2) {
+ if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria2) {
ui->uuid->hide();
ui->uuid_l->hide();
ui->uuidgen->hide();
@@ -61,27 +58,14 @@ void EditQUIC::onStart(std::shared_ptr _ent) {
ui->heartbeat_l->hide();
ui->uos->hide();
- if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria) { // hy1
- ui->password->hide();
- ui->password_l->hide();
- } else { // hy2
- 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);
- ui->disableMtuDiscovery->hide();
- ui->connectionReceiveWindow->hide();
- ui->connectionReceiveWindow_l->hide();
- ui->streamReceiveWindow->hide();
- ui->streamReceiveWindow_l->hide();
- }
+ ui->alpn->hide();
+ ui->alpn_l->hide();
+ ui->TLS->removeItem(ui->alpn_sp);
+ ui->disableMtuDiscovery->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) {
ui->hopPort->hide();
ui->hopPort_l->hide();
@@ -91,15 +75,9 @@ void EditQUIC::onStart(std::shared_ptr _ent) {
ui->uploadMbps_l->hide();
ui->downloadMbps->hide();
ui->downloadMbps_l->hide();
- ui->hyProtocol->hide();
- ui->hyProtocol_l->hide();
ui->disableMtuDiscovery->hide();
ui->obfsPassword->hide();
ui->obfsPassword_l->hide();
- ui->authPayload->hide();
- ui->authPayload_l->hide();
- ui->authPayloadType->hide();
- ui->authPayloadType_l->hide();
ui->streamReceiveWindow->hide();
ui->streamReceiveWindow_l->hide();
ui->connectionReceiveWindow->hide();
@@ -113,16 +91,13 @@ bool EditQUIC::onEnd() {
P_SAVE_BOOL(forceExternal);
- // Hysteria
+ // Hysteria 2
P_SAVE_STRING(hopPort);
P_SAVE_INT(hopInterval);
P_SAVE_INT(uploadMbps);
P_SAVE_INT(downloadMbps);
- P_SAVE_COMBO_INT(hyProtocol);
P_SAVE_BOOL(disableMtuDiscovery)
P_SAVE_STRING(obfsPassword);
- P_SAVE_COMBO_INT(authPayloadType);
- P_SAVE_STRING(authPayload);
P_SAVE_INT(streamReceiveWindow);
P_SAVE_INT(connectionReceiveWindow);
diff --git a/ui/edit/edit_quic.ui b/ui/edit/edit_quic.ui
index 385beea..3416d89 100644
--- a/ui/edit/edit_quic.ui
+++ b/ui/edit/edit_quic.ui
@@ -16,6 +16,48 @@
-
+
-
+
+
-
+
+
+ Download (Mbps)
+
+
+
+ -
+
+
+
+
+ -
+
+
-
+
+
+ Hop Port
+
+
+
+ -
+
+
+
+
+ -
+
+
-
+
+
+ Hop Interval (s)
+
+
+
+ -
+
+
+
+
-
-
@@ -37,20 +79,27 @@
- -
-
+
-
+
-
-
+
- Hop Port
+ Upload (Mbps)
-
-
+
+ -
+
+
+ Zero Rtt Handshake
+
+
+
-
-
@@ -81,48 +130,6 @@
- -
-
-
-
-
-
- Download (Mbps)
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- Hop Interval (s)
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- Upload (Mbps)
-
-
-
- -
-
-
-
-
-
-
@@ -148,14 +155,18 @@
- -
-
+
+
+ -
+
+
-
+
- Zero Rtt Handshake
+ Force use external core
- -
+
-
Requires sing-box server
@@ -165,10 +176,16 @@
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
- Force use external core
+ Disable MTU Discovery
@@ -176,93 +193,38 @@
-
-
-
+
-
+
+
+ -
Obfs Password
- -
-
-
- Protocol
-
-
-
- -
-
-
-
-
-
-
-
- QUIC
-
-
- -
-
- FakeTCP
-
-
- -
-
- wechat-video
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Disable MTU Discovery
-
-
-
-
-
- -
-
-
-
-
-
-
+
-
+
+
+ Generate UUID
+
+
-
-
-
-
- 0
- 0
-
-
+
- Auth Type
+ UUID
+ -
+
+
-
-
-
-
- 0
- 0
-
-
-
- Auth Payload
-
-
-
- -
@@ -275,44 +237,8 @@
- -
-
-
- UUID
-
-
-
- -
-
-
- Generate UUID
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- NONE
-
-
- -
-
- STRING
-
-
- -
-
- BASE64
-
-
-
+
@@ -428,11 +354,8 @@
zeroRttHandshake
forceExternal
uos
- hyProtocol
disableMtuDiscovery
obfsPassword
- authPayloadType
- authPayload
uuid
uuidgen
password