diff --git a/fmt/Bean2CoreObj_box.cpp b/fmt/Bean2CoreObj_box.cpp index b3e4300..10864d9 100644 --- a/fmt/Bean2CoreObj_box.cpp +++ b/fmt/Bean2CoreObj_box.cpp @@ -85,6 +85,7 @@ namespace NekoRay::fmt { outbound["server_port"] = serverPort; outbound["method"] = method; outbound["password"] = password; + outbound["udp_over_tcp"] = uot; if (!plugin.trimmed().isEmpty()) { outbound["plugin"] = SubStrBefore(plugin, ";"); diff --git a/fmt/ShadowSocksBean.hpp b/fmt/ShadowSocksBean.hpp index d0b0159..83cc1d5 100644 --- a/fmt/ShadowSocksBean.hpp +++ b/fmt/ShadowSocksBean.hpp @@ -9,6 +9,7 @@ namespace NekoRay::fmt { QString method = "aes-128-gcm"; QString password = ""; QString plugin = ""; + bool uot = false; QSharedPointer stream = QSharedPointer(new V2rayStreamSettings()); @@ -16,6 +17,7 @@ namespace NekoRay::fmt { _add(new configItem("method", &method, itemType::string)); _add(new configItem("pass", &password, itemType::string)); _add(new configItem("plugin", &plugin, itemType::string)); + _add(new configItem("uot", &uot, itemType::boolean)); _add(new configItem("stream", dynamic_cast(stream.get()), itemType::jsonStore)); }; diff --git a/ui/edit/edit_shadowsocks.cpp b/ui/edit/edit_shadowsocks.cpp index cc51b1a..8d28fa8 100644 --- a/ui/edit/edit_shadowsocks.cpp +++ b/ui/edit/edit_shadowsocks.cpp @@ -8,6 +8,8 @@ EditShadowSocks::EditShadowSocks(QWidget *parent) : QWidget(parent), ui->setupUi(this); if (IS_NEKO_BOX) { ui->method->addItems({"2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305"}); + } else { + ui->uot->hide(); } } @@ -20,6 +22,7 @@ void EditShadowSocks::onStart(QSharedPointer _ent) { auto bean = this->ent->ShadowSocksBean(); ui->method->setCurrentText(bean->method); + ui->uot->setChecked(bean->uot); ui->password->setText(bean->password); auto ssPlugin = bean->plugin.split(";"); if (!ssPlugin.empty()) { @@ -33,10 +36,11 @@ bool EditShadowSocks::onEnd() { bean->method = ui->method->currentText(); bean->password = ui->password->text(); + bean->uot = ui->uot->isChecked(); bean->plugin = ui->plugin->currentText(); if (!bean->plugin.isEmpty()) { bean->plugin += ";" + ui->plugin_opts->text(); } return true; -} \ No newline at end of file +} diff --git a/ui/edit/edit_shadowsocks.ui b/ui/edit/edit_shadowsocks.ui index f8c0f6b..92ccfb2 100644 --- a/ui/edit/edit_shadowsocks.ui +++ b/ui/edit/edit_shadowsocks.ui @@ -14,10 +14,20 @@ Form - - + + - Plugin Args + Encryption + + + + + + + + + + Plugin @@ -31,40 +41,6 @@ - - - - Encryption - - - - - - - - - - - - - obfs-local - - - - - v2ray-plugin - - - - - ssr - - - - - - - @@ -162,10 +138,41 @@ - - + + - Plugin + Plugin Args + + + + + + + + + + + + + obfs-local + + + + + v2ray-plugin + + + + + ssr + + + + + + + + UDP over TCP