diff --git a/fmt/Bean2CoreObj_box.cpp b/fmt/Bean2CoreObj_box.cpp index 27e4403..fa4f4eb 100644 --- a/fmt/Bean2CoreObj_box.cpp +++ b/fmt/Bean2CoreObj_box.cpp @@ -204,7 +204,11 @@ namespace NekoGui_fmt { outbound["uuid"] = uuid; outbound["password"] = password; outbound["congestion_control"] = congestionControl; - outbound["udp_relay_mode"] = udpRelayMode; + if (uos) { + outbound["udp_over_stream"]= true; + } else { + outbound["udp_relay_mode"] = udpRelayMode; + } outbound["zero_rtt_handshake"] = zeroRttHandshake; if (!heartbeat.trimmed().isEmpty()) outbound["heartbeat"] = heartbeat; } diff --git a/fmt/QUICBean.hpp b/fmt/QUICBean.hpp index 56f7e94..e64fa41 100644 --- a/fmt/QUICBean.hpp +++ b/fmt/QUICBean.hpp @@ -42,6 +42,7 @@ namespace NekoGui_fmt { QString udpRelayMode = "native"; bool zeroRttHandshake = false; QString heartbeat = "10s"; + bool uos = false; // TLS @@ -72,6 +73,7 @@ namespace NekoGui_fmt { _add(new configItem("udpRelayMode", &udpRelayMode, itemType::string)); _add(new configItem("zeroRttHandshake", &zeroRttHandshake, itemType::boolean)); _add(new configItem("heartbeat", &heartbeat, itemType::string)); + _add(new configItem("uos", &uos, itemType::boolean)); } // TLS _add(new configItem("allowInsecure", &allowInsecure, itemType::boolean)); diff --git a/sub/GroupUpdater.cpp b/sub/GroupUpdater.cpp index c1ec44d..d5853d8 100644 --- a/sub/GroupUpdater.cpp +++ b/sub/GroupUpdater.cpp @@ -446,6 +446,8 @@ namespace NekoGui_sub { bean->caText = Node2QString(proxy["ca-str"]); bean->sni = Node2QString(proxy["sni"]); + if (Node2Bool(proxy["udp-over-stream"])) bean->uos = true; + if (!Node2QString(proxy["ip"]).isEmpty()) { if (bean->sni.isEmpty()) bean->sni = bean->serverAddress; bean->serverAddress = Node2QString(proxy["ip"]); diff --git a/ui/edit/edit_quic.cpp b/ui/edit/edit_quic.cpp index 376c5b2..1c1ebe4 100644 --- a/ui/edit/edit_quic.cpp +++ b/ui/edit/edit_quic.cpp @@ -44,6 +44,7 @@ void EditQUIC::onStart(std::shared_ptr _ent) { ui->zeroRttHandshake->hide(); ui->heartbeat->hide(); ui->heartbeat_l->hide(); + ui->uos->hide(); } else if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_TUIC) { P_LOAD_STRING(uuid); P_LOAD_STRING(password); @@ -51,6 +52,7 @@ void EditQUIC::onStart(std::shared_ptr _ent) { P_LOAD_COMBO_STRING(udpRelayMode); P_LOAD_BOOL(zeroRttHandshake); P_LOAD_STRING(heartbeat); + P_LOAD_BOOL(uos); ui->hopPort->hide(); ui->hopPort_l->hide(); @@ -73,6 +75,9 @@ void EditQUIC::onStart(std::shared_ptr _ent) { ui->streamReceiveWindow_l->hide(); ui->connectionReceiveWindow->hide(); ui->connectionReceiveWindow_l->hide(); + if (!IS_NEKO_BOX) { + ui->uos->hide(); + } } // TLS @@ -106,6 +111,7 @@ bool EditQUIC::onEnd() { P_SAVE_COMBO_STRING(udpRelayMode); P_SAVE_BOOL(zeroRttHandshake); P_SAVE_STRING(heartbeat); + P_SAVE_BOOL(uos); // TLS P_SAVE_STRING(sni); diff --git a/ui/edit/edit_quic.ui b/ui/edit/edit_quic.ui index c0cde74..3a1c863 100644 --- a/ui/edit/edit_quic.ui +++ b/ui/edit/edit_quic.ui @@ -16,17 +16,24 @@ - - + + - + - Download (Mbps) + Heartbeat - + + + + 0 + 0 + + + @@ -44,31 +51,6 @@ - - - - - - UDP Relay Mode - - - - - - - - native - - - - - quic - - - - - - @@ -99,17 +81,17 @@ - - + + - + - Upload (Mbps) + Download (Mbps) - + @@ -127,6 +109,45 @@ + + + + + + Upload (Mbps) + + + + + + + + + + + + + + UDP Relay Mode + + + + + + + + native + + + + + quic + + + + + + @@ -134,26 +155,12 @@ - - - - - - Heartbeat - - - - - - - - 0 - 0 - - - - - + + + + UDP over Stream + +