From 9efde1a59e5ad2227e9459cfd17a0fedb7a3f7e9 Mon Sep 17 00:00:00 2001
From: arm64v8a <48624112+arm64v8a@users.noreply.github.com>
Date: Tue, 5 Sep 2023 21:52:01 +0900
Subject: [PATCH] Support hysteria2
---
db/ConfigBuilder.cpp | 2 +-
fmt/Bean2CoreObj_box.cpp | 6 ++---
fmt/Bean2External.cpp | 7 +++---
fmt/QUICBean.hpp | 21 +++++++++++++++---
go/cmd/nekobox_core/go.mod | 11 +++++-----
go/cmd/nekobox_core/go.sum | 29 +++++++++---------------
libs/get_source_env.sh | 4 ++--
translations/fa_IR.ts | 8 +++++++
translations/ru_RU.ts | 8 +++++++
translations/zh_CN.ts | 8 +++++++
ui/edit/dialog_edit_profile.cpp | 4 ++--
ui/edit/edit_quic.cpp | 26 ++++++++++++++++++++--
ui/edit/edit_quic.ui | 39 ++++++++++++++++++++++-----------
13 files changed, 119 insertions(+), 54 deletions(-)
diff --git a/db/ConfigBuilder.cpp b/db/ConfigBuilder.cpp
index 50c7bd8cf..af2273757 100644
--- a/db/ConfigBuilder.cpp
+++ b/db/ConfigBuilder.cpp
@@ -578,7 +578,7 @@ namespace NekoGui {
if (thisExternalStat > 0) {
auto extR = ent->bean->BuildExternal(ext_mapping_port, ext_socks_port, thisExternalStat);
if (extR.program.isEmpty()) {
- status->result->error = QObject::tr("Core not found: %1").arg(ent->bean->DisplayType());
+ status->result->error = QObject::tr("Core not found: %1").arg(ent->bean->DisplayCoreType());
return {};
}
if (!extR.error.isEmpty()) { // rejected
diff --git a/fmt/Bean2CoreObj_box.cpp b/fmt/Bean2CoreObj_box.cpp
index e344943ce..4c631a8af 100644
--- a/fmt/Bean2CoreObj_box.cpp
+++ b/fmt/Bean2CoreObj_box.cpp
@@ -180,6 +180,7 @@ namespace NekoGui_fmt {
{"server_name", sni},
};
if (!alpn.trimmed().isEmpty()) coreTlsObj["alpn"] = QList2QJsonArray(alpn.split(","));
+ if (proxy_type == proxy_Hysteria2) coreTlsObj["alpn"] = "h3";
QJsonObject outbound{
{"server", serverAddress},
@@ -202,9 +203,8 @@ namespace NekoGui_fmt {
} else if (proxy_type == proxy_Hysteria2) {
outbound["type"] = "hysteria2";
outbound["password"] = authPayload;
-
- if (uploadMbps > 0) outbound["up_mbps"] = uploadMbps;
- if (downloadMbps > 0) outbound["down_mbps"] = downloadMbps;
+ outbound["up_mbps"] = uploadMbps;
+ outbound["down_mbps"] = downloadMbps;
if (!obfsPassword.isEmpty()) {
outbound["obfs"] = QJsonObject{
{"type", "salamander"},
diff --git a/fmt/Bean2External.cpp b/fmt/Bean2External.cpp
index 808d9d02f..411f7c79a 100644
--- a/fmt/Bean2External.cpp
+++ b/fmt/Bean2External.cpp
@@ -71,7 +71,7 @@ namespace NekoGui_fmt {
};
if (IS_NEKO_BOX) {
- if (proxy_type == proxy_TUIC || hyProtocol == hysteria_protocol_udp) {
+ if (!forceExternal && (proxy_type == proxy_TUIC || hyProtocol == hysteria_protocol_udp)) {
// sing-box support
return 0;
} else {
@@ -213,11 +213,12 @@ namespace NekoGui_fmt {
if (streamReceiveWindow > 0) quic["initStreamReceiveWindow"] = streamReceiveWindow;
if (connectionReceiveWindow > 0) quic["initConnReceiveWindow"] = connectionReceiveWindow;
if (disableMtuDiscovery) quic["disablePathMTUDiscovery"] = true;
+ config["quic"] = quic;
- config["fastopen"] = true;
+ config["fastOpen"] = true;
config["lazy"] = true;
- if (!obfsPassword.isEmpty()) {
+ if (!obfsPassword.isEmpty()) {
QJsonObject obfs;
obfs["type"] = "salamander";
obfs["salamander"] = QJsonObject{
diff --git a/fmt/QUICBean.hpp b/fmt/QUICBean.hpp
index 49d47e524..405ee04d3 100644
--- a/fmt/QUICBean.hpp
+++ b/fmt/QUICBean.hpp
@@ -10,6 +10,8 @@ namespace NekoGui_fmt {
static constexpr int proxy_Hysteria2 = 3;
int proxy_type = proxy_Hysteria;
+ bool forceExternal = false;
+
// Hysteria
static constexpr int hysteria_protocol_udp = 0;
@@ -68,10 +70,12 @@ 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_Hysteria2) {
+ if (proxy_type == proxy_Hysteria) { // hy1
_add(new configItem("authPayloadType", &authPayloadType, itemType::integer));
_add(new configItem("protocol", &hyProtocol, itemType::integer));
- } else {
+ } else { // hy2
+ uploadMbps = 0;
+ downloadMbps = 0;
_add(new configItem("username", &username, itemType::string));
}
@@ -84,6 +88,7 @@ namespace NekoGui_fmt {
_add(new configItem("heartbeat", &heartbeat, itemType::string));
_add(new configItem("uos", &uos, itemType::boolean));
}
+ _add(new configItem("forceExternal", &forceExternal, itemType::boolean));
// TLS
_add(new configItem("allowInsecure", &allowInsecure, itemType::boolean));
_add(new configItem("sni", &sni, itemType::string));
@@ -97,7 +102,17 @@ namespace NekoGui_fmt {
return ::DisplayAddress(serverAddress, serverPort);
}
- QString DisplayCoreType() override { return NeedExternal(true) == 0 ? software_core_name : "Hysteria"; };
+ QString DisplayCoreType() override {
+ if (NeedExternal(true) == 0) {
+ return software_core_name;
+ } else if (proxy_type == proxy_TUIC) {
+ return "tuic";
+ } else if (proxy_type == proxy_Hysteria) {
+ return "hysteria";
+ } else {
+ return "hysteria2";
+ }
+ }
QString DisplayType() override { return proxy_type == proxy_TUIC ? "TUIC" : "Hysteria"; };
diff --git a/go/cmd/nekobox_core/go.mod b/go/cmd/nekobox_core/go.mod
index 846dc492e..bb5d0d665 100644
--- a/go/cmd/nekobox_core/go.mod
+++ b/go/cmd/nekobox_core/go.mod
@@ -18,7 +18,7 @@ require (
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/caddyserver/certmagic v0.19.2 // indirect
- github.com/cloudflare/circl v1.2.1-0.20221019164342-6ab4dfed8f3c // indirect
+ github.com/cloudflare/circl v1.3.3 // indirect
github.com/cretz/bine v0.2.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
@@ -28,7 +28,6 @@ require (
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gofrs/uuid/v5 v5.0.0 // indirect
- github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
@@ -50,15 +49,15 @@ require (
github.com/pires/go-proxyproto v0.7.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-20 v0.3.3 // indirect
- github.com/sagernet/cloudflare-tls v0.0.0-20221031050923-d70792f4c3a0 // indirect
+ github.com/sagernet/cloudflare-tls v0.0.0-20230829051644-4a68352d0c4a // indirect
github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 // indirect
github.com/sagernet/gvisor v0.0.0-20230627031050-1ab0276e0dd2 // indirect
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 // indirect
- github.com/sagernet/quic-go v0.0.0-20230825040534-0cd917b2ddda // indirect
+ github.com/sagernet/quic-go v0.0.0-20230831052420-45809eee2e86 // indirect
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 // indirect
- github.com/sagernet/sing v0.2.10-0.20230824115837-8d731e68853a // indirect
+ github.com/sagernet/sing v0.2.10-0.20230830132630-30bf19f2833c // indirect
github.com/sagernet/sing-dns v0.1.9-0.20230824120133-4d5cbceb40c1 // indirect
- github.com/sagernet/sing-mux v0.1.3-0.20230811111955-dc1639b5204c // indirect
+ github.com/sagernet/sing-mux v0.1.3-0.20230830095209-2a10ebd53ba8 // indirect
github.com/sagernet/sing-shadowsocks v0.2.4 // indirect
github.com/sagernet/sing-shadowsocks2 v0.1.3 // indirect
github.com/sagernet/sing-shadowtls v0.1.4 // indirect
diff --git a/go/cmd/nekobox_core/go.sum b/go/cmd/nekobox_core/go.sum
index 3b9adc71a..3d4c9f3cd 100644
--- a/go/cmd/nekobox_core/go.sum
+++ b/go/cmd/nekobox_core/go.sum
@@ -22,8 +22,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/cloudflare/circl v1.2.1-0.20221019164342-6ab4dfed8f3c h1:K1VdSnBZiGapczwcUKnE1qcsMBclA84DUOD2NG/78VY=
-github.com/cloudflare/circl v1.2.1-0.20221019164342-6ab4dfed8f3c/go.mod h1:+CauBF6R70Jqcyl8N2hC8pAXYbWkGIezuSbuGLtRhnw=
+github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
+github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cretz/bine v0.1.0/go.mod h1:6PF6fWAvYtwjRGkAuDEJeWNOv3a2hUouSP/yRYXmvHw=
@@ -59,8 +59,6 @@ github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
-github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
@@ -124,26 +122,26 @@ github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1
github.com/quic-go/qtls-go1-20 v0.3.3 h1:17/glZSLI9P9fDAeyCHBFSWSqJcwx1byhLwP5eUIDCM=
github.com/quic-go/qtls-go1-20 v0.3.3/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/sagernet/cloudflare-tls v0.0.0-20221031050923-d70792f4c3a0 h1:KyhtFFt1Jtp5vW2ohNvstvQffTOQ/s5vENuGXzdA+TM=
-github.com/sagernet/cloudflare-tls v0.0.0-20221031050923-d70792f4c3a0/go.mod h1:D4SFEOkJK+4W1v86ZhX0jPM0rAL498fyQAChqMtes/I=
+github.com/sagernet/cloudflare-tls v0.0.0-20230829051644-4a68352d0c4a h1:wZHruBxZCsQLXHAozWpnJBL3wJ/XufDpz0qKtgpSnA4=
+github.com/sagernet/cloudflare-tls v0.0.0-20230829051644-4a68352d0c4a/go.mod h1:dNV1ZP9y3qx5ltULeKaQZTZWTLHflgW5DES+Ses7cMI=
github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 h1:5+m7c6AkmAylhauulqN/c5dnh8/KssrE9c93TQrXldA=
github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61/go.mod h1:QUQ4RRHD6hGGHdFMEtR8T2P6GS6R3D/CXKdaYHKKXms=
github.com/sagernet/gvisor v0.0.0-20230627031050-1ab0276e0dd2 h1:dnkKrzapqtAwjTSWt6hdPrARORfoYvuUczynvRLrueo=
github.com/sagernet/gvisor v0.0.0-20230627031050-1ab0276e0dd2/go.mod h1:1JUiV7nGuf++YFm9eWZ8q2lrwHmhcUGzptMl/vL1+LA=
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 h1:iL5gZI3uFp0X6EslacyapiRz7LLSJyr4RajF/BhMVyE=
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
-github.com/sagernet/quic-go v0.0.0-20230825040534-0cd917b2ddda h1:7J/hnOFqCThiCrVpvr0wKO+Dic/XPSulPr5yI8FVJMs=
-github.com/sagernet/quic-go v0.0.0-20230825040534-0cd917b2ddda/go.mod h1:Iw8Tt3dMqC/61cMHa0nN5i/958oYuuMnQCMOSPx+xcg=
+github.com/sagernet/quic-go v0.0.0-20230831052420-45809eee2e86 h1:g4TEg9inAtA1FDTXpNrvmx72nN5mTOLQrJce6fVxF9g=
+github.com/sagernet/quic-go v0.0.0-20230831052420-45809eee2e86/go.mod h1:O4Cj7TmMOvqD6S0XMqJRZfcYzA3m0H0ARbbaJFB0p7A=
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byLGkEnIYp6grlXfo1QYUfiYFGjewIdc=
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU=
github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk=
-github.com/sagernet/sing v0.2.10-0.20230824115837-8d731e68853a h1:eV4HEz9NP7eAlQ/IHD6OF2VVM6ke4Vw6htuSAsvgtDk=
-github.com/sagernet/sing v0.2.10-0.20230824115837-8d731e68853a/go.mod h1:9uOZwWkhT2Z2WldolLxX34s+1svAX4i4vvz5hy8u1MA=
+github.com/sagernet/sing v0.2.10-0.20230830132630-30bf19f2833c h1:J2ptRncTNy+ZHfcFYSBfTmpvmgNlSEUZz6sDjh1np/Y=
+github.com/sagernet/sing v0.2.10-0.20230830132630-30bf19f2833c/go.mod h1:9uOZwWkhT2Z2WldolLxX34s+1svAX4i4vvz5hy8u1MA=
github.com/sagernet/sing-dns v0.1.9-0.20230824120133-4d5cbceb40c1 h1:5w+jXz8y/8UQAxO74TjftN5okYkpg5mGvVxXunlKdqI=
github.com/sagernet/sing-dns v0.1.9-0.20230824120133-4d5cbceb40c1/go.mod h1:Kg98PBJEg/08jsNFtmZWmPomhskn9Ausn50ecNm4M+8=
-github.com/sagernet/sing-mux v0.1.3-0.20230811111955-dc1639b5204c h1:35/FowAvt3Z62mck0TXzVc4jS5R5CWq62qcV2P1cp0I=
-github.com/sagernet/sing-mux v0.1.3-0.20230811111955-dc1639b5204c/go.mod h1:TKxqIvfQQgd36jp2tzsPavGjYTVZilV+atip1cssjIY=
+github.com/sagernet/sing-mux v0.1.3-0.20230830095209-2a10ebd53ba8 h1:UyUkEUEGqfIGqzOJ7OuJry4slgcT/qb0etDJ+89LTAs=
+github.com/sagernet/sing-mux v0.1.3-0.20230830095209-2a10ebd53ba8/go.mod h1:TKxqIvfQQgd36jp2tzsPavGjYTVZilV+atip1cssjIY=
github.com/sagernet/sing-shadowsocks v0.2.4 h1:s/CqXlvFAZhlIoHWUwPw5CoNnQ9Ibki9pckjuugtVfY=
github.com/sagernet/sing-shadowsocks v0.2.4/go.mod h1:80fNKP0wnqlu85GZXV1H1vDPC/2t+dQbFggOw4XuFUM=
github.com/sagernet/sing-shadowsocks2 v0.1.3 h1:WXoLvCFi5JTFBRYorf1YePGYIQyJ/zbsBM6Fwbl5kGA=
@@ -185,7 +183,6 @@ github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 h1:gga7acRE695AP
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/zeebo/assert v1.1.0 h1:hU1L1vLTHsnO8x8c9KAR5GmM5QscxHg5RNU5z5qbUWY=
github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/blake3 v0.2.3 h1:TFoLXsjeXqRNFxSbk35Dk4YtszE/MQQGK10BH4ptoTg=
@@ -219,7 +216,6 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -231,7 +227,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
@@ -242,7 +237,6 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -253,9 +247,7 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -280,7 +272,6 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 h1:Vve/L0v7CXXuxUmaMGIEK/dEeq7uiqb5qBgQrZzIE7E=
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/libs/get_source_env.sh b/libs/get_source_env.sh
index b20ed22d0..29822ccd0 100644
--- a/libs/get_source_env.sh
+++ b/libs/get_source_env.sh
@@ -1,9 +1,9 @@
if [ ! -z $ENV_NEKORAY ]; then
- export COMMIT_SING_BOX_EXTRA="70387142a28f10663b847988306ff6899fce0176"
+ export COMMIT_SING_BOX_EXTRA="2d7e05f22f2c3285ca929aaa0cad79ba4fd3e1fb"
export COMMIT_MATSURI_XRAY="01208225ee7e508044cca8eb6776a117bcecd997"
fi
if [ ! -z $ENV_SING_BOX_EXTRA ]; then
source libs/get_source_env.sh
- # export COMMIT_SING_BOX=""
+ export COMMIT_LIBNEKO="a26f0dbb1467bd181f76e2560e956633d9637e9d"
fi
diff --git a/translations/fa_IR.ts b/translations/fa_IR.ts
index 68bbdf2e9..3f36badb2 100644
--- a/translations/fa_IR.ts
+++ b/translations/fa_IR.ts
@@ -972,6 +972,14 @@ This needs to be run NekoBox with administrator privileges.
+
+
+ نام کاربری
+
+
+
+
+
EditShadowSocks
diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts
index 983c8a697..c8495594b 100644
--- a/translations/ru_RU.ts
+++ b/translations/ru_RU.ts
@@ -979,6 +979,14 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun
Режим UDP Relay
+
+
+ Имя пользователя
+
+
+
+
+
EditShadowSocks
diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts
index 26a405abe..98404dce1 100644
--- a/translations/zh_CN.ts
+++ b/translations/zh_CN.ts
@@ -980,6 +980,14 @@ This needs to be run NekoBox with administrator privileges.
不发送服务器名称指示
+
+
+ 用户名
+
+
+
+ 强制使用外部核心
+
EditShadowSocks
diff --git a/ui/edit/dialog_edit_profile.cpp b/ui/edit/dialog_edit_profile.cpp
index 4eb524fd1..65d9c713f 100644
--- a/ui/edit/dialog_edit_profile.cpp
+++ b/ui/edit/dialog_edit_profile.cpp
@@ -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");
diff --git a/ui/edit/edit_quic.cpp b/ui/edit/edit_quic.cpp
index 616f85f39..b5d74d532 100644
--- a/ui/edit/edit_quic.cpp
+++ b/ui/edit/edit_quic.cpp
@@ -29,6 +29,7 @@ void EditQUIC::onStart(std::shared_ptr _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 _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 _ent) {
bool EditQUIC::onEnd() {
auto bean = this->ent->QUICBean();
+ P_SAVE_BOOL(forceExternal);
+
// Hysteria
P_SAVE_STRING(hopPort);
P_SAVE_INT(hopInterval);
diff --git a/ui/edit/edit_quic.ui b/ui/edit/edit_quic.ui
index 64ff71da3..2e3e913bd 100644
--- a/ui/edit/edit_quic.ui
+++ b/ui/edit/edit_quic.ui
@@ -7,7 +7,7 @@
0
0
500
- 600
+ 628
@@ -157,8 +157,18 @@
-
+
+ Requires sing-box server
+
- UDP over Stream
+ UDP over Stream
+
+
+
+ -
+
+
+ Force use external core
@@ -358,15 +368,22 @@
- -
+
-
+
+
+ SNI
+
+
+
+ -
Allow Insecure
- -
-
+
-
+
Qt::Horizontal
@@ -381,13 +398,6 @@
- -
-
-
- SNI
-
-
-
-
@@ -432,8 +442,11 @@
udpRelayMode
heartbeat
zeroRttHandshake
+ forceExternal
+ uos
hyProtocol
disableMtuDiscovery
+ username
obfsPassword
authPayloadType
authPayload
@@ -443,8 +456,8 @@
sni
disableSni
alpn
- allowInsecure
certificate
+ allowInsecure
streamReceiveWindow
connectionReceiveWindow