diff --git a/core/server/go.mod b/core/server/go.mod
index ce83269..128a9ee 100644
--- a/core/server/go.mod
+++ b/core/server/go.mod
@@ -1,6 +1,8 @@
module Core
-go 1.23.0
+go 1.23.6
+
+toolchain go1.24.4
require (
github.com/Mahdi-zarei/speedtest-go v1.7.12
@@ -14,13 +16,16 @@ require (
github.com/sagernet/sing-tun v0.6.9
github.com/spf13/cobra v1.9.1
golang.org/x/sys v0.34.0
- google.golang.org/grpc v1.73.0
+ google.golang.org/grpc v1.74.2
+ google.golang.org/protobuf v1.36.6
)
-replace github.com/sagernet/sing-box => github.com/throneproj/sing-box v1.11.16-0.20250718050551-8b8dd68c0722
+replace github.com/sagernet/sing-box => github.com/throneproj/sing-box v1.11.16-0.20250728081827-0fde7666f683
replace github.com/sagernet/sing-dns => github.com/Mahdi-zarei/sing-dns v0.3.0-beta.14.0.20250507225909-53baf4f30fa3
+replace github.com/sagernet/wireguard-go => github.com/throneproj/wireguard-go v0.0.1-beta.7.0.20250728063157-408bba78ad26
+
require (
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.6 // indirect
@@ -76,22 +81,22 @@ require (
github.com/sagernet/wireguard-go v0.0.1-beta.7 // indirect
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854 // indirect
github.com/spf13/pflag v1.0.6 // indirect
+ github.com/tevino/abool/v2 v2.1.0 // indirect
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/zeebo/blake3 v0.2.3 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
- golang.org/x/crypto v0.36.0 // indirect
+ golang.org/x/crypto v0.38.0 // indirect
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
golang.org/x/mod v0.22.0 // indirect
- golang.org/x/net v0.38.0 // indirect
- golang.org/x/sync v0.12.0 // indirect
- golang.org/x/text v0.23.0 // indirect
+ golang.org/x/net v0.40.0 // indirect
+ golang.org/x/sync v0.14.0 // indirect
+ golang.org/x/text v0.25.0 // indirect
golang.org/x/time v0.7.0 // indirect
golang.org/x/tools v0.28.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
- google.golang.org/protobuf v1.36.6 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
lukechampine.com/blake3 v1.3.0 // indirect
)
diff --git a/core/server/go.sum b/core/server/go.sum
index af31df8..325c48d 100644
--- a/core/server/go.sum
+++ b/core/server/go.sum
@@ -24,8 +24,8 @@ github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618=
github.com/go-chi/chi/v5 v5.2.2/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0=
-github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
-github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
+github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
@@ -137,8 +137,6 @@ github.com/sagernet/smux v1.5.34-mod.2 h1:gkmBjIjlJ2zQKpLigOkFur5kBKdV6bNRoFu2Wk
github.com/sagernet/smux v1.5.34-mod.2/go.mod h1:0KW0+R+ycvA2INW4gbsd7BNyg+HEfLIAxa5N02/28Zc=
github.com/sagernet/utls v1.6.7 h1:Ep3+aJ8FUGGta+II2IEVNUc3EDhaRCZINWkj/LloIA8=
github.com/sagernet/utls v1.6.7/go.mod h1:Uua1TKO/FFuAhLr9rkaVnnrTmmiItzDjv1BUb2+ERwM=
-github.com/sagernet/wireguard-go v0.0.1-beta.7 h1:ltgBwYHfr+9Wz1eG59NiWnHrYEkDKHG7otNZvu85DXI=
-github.com/sagernet/wireguard-go v0.0.1-beta.7/go.mod h1:jGXij2Gn2wbrWuYNUmmNhf1dwcZtvyAvQoe8Xd8MbUo=
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854 h1:6uUiZcDRnZSAegryaUGwPC/Fj13JSHwiTftrXhMmYOc=
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854/go.mod h1:LtfoSK3+NG57tvnVEHgcuBW9ujgE8enPSgzgwStwCAA=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
@@ -157,8 +155,12 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/throneproj/sing-box v1.11.16-0.20250718050551-8b8dd68c0722 h1:eYSubV7jrAS8IjeTbVEbNmIreO/eZPFKcGKLtlQvUI0=
-github.com/throneproj/sing-box v1.11.16-0.20250718050551-8b8dd68c0722/go.mod h1:fW6kSjfa9oRrdvUSfAc3fLEqFZq1M97eSBs5Sa6O7O4=
+github.com/tevino/abool/v2 v2.1.0 h1:7w+Vf9f/5gmKT4m4qkayb33/92M+Um45F2BkHOR+L/c=
+github.com/tevino/abool/v2 v2.1.0/go.mod h1:+Lmlqk6bHDWHqN1cbxqhwEAwMPXgc8I1SDEamtseuXY=
+github.com/throneproj/sing-box v1.11.16-0.20250728081827-0fde7666f683 h1:tGNy8A8r32skfYLExZoRKfKGGtZxKGvO317rrcHRSCc=
+github.com/throneproj/sing-box v1.11.16-0.20250728081827-0fde7666f683/go.mod h1:ys6+R67GZ1f94PGFqVQ6xbWemnS2B8Ok8IltkPkaN/0=
+github.com/throneproj/wireguard-go v0.0.1-beta.7.0.20250728063157-408bba78ad26 h1:bBzqh7xTshvPjTFz4URNj/xbPA/d0BOwUM2R83FEMGU=
+github.com/throneproj/wireguard-go v0.0.1-beta.7.0.20250728063157-408bba78ad26/go.mod h1:akc2Wh+rX9bFFNnHJGsQ8VIV3eJI1LXJYgx2Y+8lcW8=
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 h1:tHNk7XK9GkmKUR6Gh8gVBKXc2MVSZ4G/NnWLtzw4gNA=
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923/go.mod h1:eLL9Nub3yfAho7qB0MzZizFhTU2QkLeoVsWdHtDW264=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
@@ -171,16 +173,16 @@ github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo=
github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
-go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
-go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
-go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
-go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
-go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
-go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
-go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
-go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
-go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
-go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
+go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
+go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
+go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
+go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
+go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs=
+go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY=
+go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis=
+go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4=
+go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
+go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -190,18 +192,18 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
-golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
-golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
+golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
+golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo=
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
-golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
-golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
-golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
+golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
+golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
+golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
+golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -212,12 +214,12 @@ golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
-golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
+golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
+golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
-golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
+golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
+golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -225,10 +227,10 @@ golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
-google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok=
-google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
+google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4=
+google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/include/configs/proxy/WireguardBean.h b/include/configs/proxy/WireguardBean.h
index 78888a5..905468c 100644
--- a/include/configs/proxy/WireguardBean.h
+++ b/include/configs/proxy/WireguardBean.h
@@ -13,9 +13,20 @@ namespace Configs {
QStringList localAddress;
int MTU = 1420;
bool useSystemInterface = false;
- bool enableGSO = false;
int workerCount = 0;
+ // Amenzia Options
+ bool enable_amenzia = false;
+ int junk_packet_count;
+ int junk_packet_min_size;
+ int junk_packet_max_size;
+ int init_packet_junk_size;
+ int response_packet_junk_size;
+ int init_packet_magic_header;
+ int response_packet_magic_header;
+ int underload_packet_magic_header;
+ int transport_packet_magic_header;
+
WireguardBean() : AbstractBean(0) {
_add(new configItem("private_key", &privateKey, itemType::string));
_add(new configItem("public_key", &publicKey, itemType::string));
@@ -25,8 +36,18 @@ namespace Configs {
_add(new configItem("local_address", &localAddress, itemType::stringList));
_add(new configItem("mtu", &MTU, itemType::integer));
_add(new configItem("use_system_proxy", &useSystemInterface, itemType::boolean));
- _add(new configItem("enable_gso", &enableGSO, itemType::boolean));
_add(new configItem("worker_count", &workerCount, itemType::integer));
+
+ _add(new configItem("enable_amenzia", &enable_amenzia, itemType::boolean));
+ _add(new configItem("junk_packet_count", &junk_packet_count, itemType::integer));
+ _add(new configItem("junk_packet_min_size", &junk_packet_min_size, itemType::integer));
+ _add(new configItem("junk_packet_max_size", &junk_packet_max_size, itemType::integer));
+ _add(new configItem("init_packet_junk_size", &init_packet_junk_size, itemType::integer));
+ _add(new configItem("response_packet_junk_size", &response_packet_junk_size, itemType::integer));
+ _add(new configItem("init_packet_magic_header", &init_packet_magic_header, itemType::integer));
+ _add(new configItem("response_packet_magic_header", &response_packet_magic_header, itemType::integer));
+ _add(new configItem("underload_packet_magic_header", &underload_packet_magic_header, itemType::integer));
+ _add(new configItem("transport_packet_magic_header", &transport_packet_magic_header, itemType::integer));
};
QString FormatReserved() {
diff --git a/include/ui/profile/edit_wireguard.ui b/include/ui/profile/edit_wireguard.ui
index f4e42b4..1a34ab7 100644
--- a/include/ui/profile/edit_wireguard.ui
+++ b/include/ui/profile/edit_wireguard.ui
@@ -7,108 +7,54 @@
0
0
400
- 326
+ 657
EditWireguard
-
- -
-
-
- -
-
-
- Public Key
-
-
-
- -
-
-
- -
-
-
- -
-
-
- Enable GSO
-
-
-
- -
-
-
- Pre Shared Key
-
-
-
- -
-
-
- -
-
-
- <html><head/><body><p>comma seperated list of subnets</p></body></html>
-
-
- Local Address
-
-
-
- -
-
-
- MTU
-
-
-
- -
-
-
- Use System Interface
-
-
-
- -
-
-
- -
+
+
-
Private Key
- -
-
+
-
+
- -
-
+
-
+
- Workers
+ Public Key
- -
-
+
-
+
+
+ -
+
- 1420
+ Pre Shared Key
- -
+
-
+
+
+ -
Reserved
- -
-
+
-
+
- -
+
-
<html><head/><body><p>persistent_keepalive_interval in seconds</p></body></html>
@@ -121,6 +67,159 @@
+ -
+
+
+ -
+
+
+ <html><head/><body><p>comma seperated list of subnets</p></body></html>
+
+
+ Local Address
+
+
+
+ -
+
+
+ -
+
+
+ MTU
+
+
+
+ -
+
+
+ 1420
+
+
+
+ -
+
+
+ Workers
+
+
+
+ -
+
+
+ -
+
+
+ Use System Interface
+
+
+
+ -
+
+
+ Amenzia Settings
+
+
+
-
+
+
+ Enable
+
+
+
+ -
+
+
+ -
+
+
+ Junk Packet Count
+
+
+
+ -
+
+
+ -
+
+
+ Junk Packet Min Size
+
+
+
+ -
+
+
+ Junk Packet Max Size
+
+
+
+ -
+
+
+ -
+
+
+ Init Packet Junk Size
+
+
+
+ -
+
+
+ -
+
+
+ Response Packet Junk Size
+
+
+
+ -
+
+
+ -
+
+
+ Init Packet Magic Header
+
+
+
+ -
+
+
+ -
+
+
+ Response Packet Magic Header
+
+
+
+ -
+
+
+ -
+
+
+ Underload Packet Magic Header
+
+
+
+ -
+
+
+ -
+
+
+ Transport Header Magic Header
+
+
+
+ -
+
+
+
+
+
diff --git a/src/configs/proxy/Bean2CoreObj_box.cpp b/src/configs/proxy/Bean2CoreObj_box.cpp
index 30a9e8c..ad3c92f 100644
--- a/src/configs/proxy/Bean2CoreObj_box.cpp
+++ b/src/configs/proxy/Bean2CoreObj_box.cpp
@@ -299,6 +299,18 @@ namespace Configs {
{"system", useSystemInterface},
{"workers", workerCount}
};
+ if (enable_amenzia)
+ {
+ outbound["junk_packet_count"] = junk_packet_count;
+ outbound["junk_packet_min_size"] = junk_packet_min_size;
+ outbound["junk_packet_max_size"] = junk_packet_max_size;
+ outbound["init_packet_junk_size"] = init_packet_junk_size;
+ outbound["response_packet_junk_size"] = response_packet_junk_size;
+ outbound["init_packet_magic_header"] = init_packet_magic_header;
+ outbound["response_packet_magic_header"] = response_packet_magic_header;
+ outbound["underload_packet_magic_header"] = underload_packet_magic_header;
+ outbound["transport_packet_magic_header"] = transport_packet_magic_header;
+ }
result.outbound = outbound;
return result;
diff --git a/src/configs/proxy/Bean2Link.cpp b/src/configs/proxy/Bean2Link.cpp
index ca21452..a9dcfcf 100644
--- a/src/configs/proxy/Bean2Link.cpp
+++ b/src/configs/proxy/Bean2Link.cpp
@@ -265,6 +265,19 @@ namespace Configs {
q.addQueryItem("use_system_interface", useSystemInterface ? "true":"false");
q.addQueryItem("local_address", localAddress.join("-"));
q.addQueryItem("workers", Int2String(workerCount));
+ if (enable_amenzia)
+ {
+ q.addQueryItem("enable_amenzia", "true");
+ q.addQueryItem("junk_packet_count", Int2String(junk_packet_count));
+ q.addQueryItem("junk_packet_min_size", Int2String(junk_packet_min_size));
+ q.addQueryItem("junk_packet_max_size", Int2String(junk_packet_max_size));
+ q.addQueryItem("init_packet_junk_size", Int2String(init_packet_junk_size));
+ q.addQueryItem("response_packet_junk_size", Int2String(response_packet_junk_size));
+ q.addQueryItem("init_packet_magic_header", Int2String(init_packet_magic_header));
+ q.addQueryItem("response_packet_magic_header", Int2String(response_packet_magic_header));
+ q.addQueryItem("underload_packet_magic_header", Int2String(underload_packet_magic_header));
+ q.addQueryItem("transport_packet_magic_header", Int2String(transport_packet_magic_header));
+ }
url.setQuery(q);
return url.toString(QUrl::FullyEncoded);
}
diff --git a/src/configs/proxy/Json2Bean.cpp b/src/configs/proxy/Json2Bean.cpp
index 5656fdd..6f0ba33 100644
--- a/src/configs/proxy/Json2Bean.cpp
+++ b/src/configs/proxy/Json2Bean.cpp
@@ -222,6 +222,21 @@ namespace Configs
localAddress = QJsonArray2QListString(obj["address"].toArray());
MTU = obj["mtu"].toInt();
useSystemInterface = obj["system"].toBool();
+
+ junk_packet_count = obj["junk_packet_count"].toInt();
+ junk_packet_min_size = obj["junk_packet_min_size"].toInt();
+ junk_packet_max_size = obj["junk_packet_max_size"].toInt();
+ init_packet_junk_size = obj["init_packet_junk_size"].toInt();
+ response_packet_junk_size = obj["response_packet_junk_size"].toInt();
+ init_packet_magic_header = obj["init_packet_magic_header"].toInt();
+ response_packet_magic_header = obj["response_packet_magic_header"].toInt();
+ underload_packet_magic_header = obj["underload_packet_magic_header"].toInt();
+ transport_packet_magic_header = obj["transport_packet_magic_header"].toInt();
+ if (junk_packet_count > 0 || junk_packet_min_size > 0 || junk_packet_max_size > 0)
+ {
+ enable_amenzia = true;
+ }
+
return true;
}
diff --git a/src/configs/proxy/Link2Bean.cpp b/src/configs/proxy/Link2Bean.cpp
index 92189eb..5d30830 100644
--- a/src/configs/proxy/Link2Bean.cpp
+++ b/src/configs/proxy/Link2Bean.cpp
@@ -363,6 +363,17 @@ namespace Configs {
useSystemInterface = query.queryItemValue("use_system_interface") == "true";
workerCount = query.queryItemValue("workers").toInt();
+ enable_amenzia = query.queryItemValue("enable_amenzia") == "true";
+ junk_packet_count = query.queryItemValue("junk_packet_count").toInt();
+ junk_packet_min_size = query.queryItemValue("junk_packet_min_size").toInt();
+ junk_packet_max_size = query.queryItemValue("junk_packet_max_size").toInt();
+ init_packet_junk_size = query.queryItemValue("init_packet_junk_size").toInt();
+ response_packet_junk_size = query.queryItemValue("response_packet_junk_size").toInt();
+ init_packet_magic_header = query.queryItemValue("init_packet_magic_header").toInt();
+ response_packet_magic_header = query.queryItemValue("response_packet_magic_header").toInt();
+ underload_packet_magic_header = query.queryItemValue("underload_packet_magic_header").toInt();
+ transport_packet_magic_header = query.queryItemValue("transport_packet_magic_header").toInt();
+
return true;
}
diff --git a/src/ui/profile/edit_wireguard.cpp b/src/ui/profile/edit_wireguard.cpp
index 0e11ce2..19a8aa5 100644
--- a/src/ui/profile/edit_wireguard.cpp
+++ b/src/ui/profile/edit_wireguard.cpp
@@ -15,7 +15,6 @@ void EditWireguard::onStart(std::shared_ptr _ent) {
auto bean = this->ent->WireguardBean();
#ifndef Q_OS_LINUX
- ui->enable_gso->hide();
adjustSize();
#endif
@@ -27,9 +26,19 @@ void EditWireguard::onStart(std::shared_ptr _ent) {
ui->persistent_keepalive->setText(Int2String(bean->persistentKeepalive));
ui->mtu->setText(Int2String(bean->MTU));
ui->sys_ifc->setChecked(bean->useSystemInterface);
- ui->enable_gso->setChecked(bean->enableGSO);
ui->local_addr->setText(bean->localAddress.join(","));
ui->workers->setText(Int2String(bean->workerCount));
+
+ ui->enable_amenzia->setChecked(bean->enable_amenzia);
+ ui->junk_packet_count->setText(Int2String(bean->junk_packet_count));
+ ui->junk_packet_min_size->setText(Int2String(bean->junk_packet_min_size));
+ ui->junk_packet_max_size->setText(Int2String(bean->junk_packet_max_size));
+ ui->init_packet_junk_size->setText(Int2String(bean->init_packet_junk_size));
+ ui->response_packet_junk_size->setText(Int2String(bean->response_packet_junk_size));
+ ui->init_packet_magic_header->setText(Int2String(bean->init_packet_magic_header));
+ ui->response_packet_magic_header->setText(Int2String(bean->response_packet_magic_header));
+ ui->underload_packet_magic_header->setText(Int2String(bean->underload_packet_magic_header));
+ ui->transport_packet_magic_header->setText(Int2String(bean->transport_packet_magic_header));
}
bool EditWireguard::onEnd() {
@@ -47,9 +56,19 @@ bool EditWireguard::onEnd() {
bean->persistentKeepalive = ui->persistent_keepalive->text().toInt();
bean->MTU = ui->mtu->text().toInt();
bean->useSystemInterface = ui->sys_ifc->isChecked();
- bean->enableGSO = ui->enable_gso->isChecked();
bean->localAddress = ui->local_addr->text().replace(" ", "").split(",");
bean->workerCount = ui->workers->text().toInt();
+ bean->enable_amenzia = ui->enable_amenzia->isChecked();
+ bean->junk_packet_count = ui->junk_packet_count->text().toInt();
+ bean->junk_packet_min_size = ui->junk_packet_min_size->text().toInt();
+ bean->junk_packet_max_size = ui->junk_packet_max_size->text().toInt();
+ bean->init_packet_junk_size = ui->init_packet_junk_size->text().toInt();
+ bean->response_packet_junk_size = ui->response_packet_junk_size->text().toInt();
+ bean->init_packet_magic_header = ui->init_packet_magic_header->text().toInt();
+ bean->response_packet_magic_header = ui->response_packet_magic_header->text().toInt();
+ bean->underload_packet_magic_header = ui->underload_packet_magic_header->text().toInt();
+ bean->transport_packet_magic_header = ui->transport_packet_magic_header->text().toInt();
+
return true;
}
\ No newline at end of file