* Adjust mtu

* Add Wireguard PresharedKey

* WireGuard config import

* AI opt

* Opt
This commit is contained in:
DHR60
2026-05-06 07:35:10 +00:00
committed by GitHub
parent 8450f2e420
commit 1a44af33d0
22 changed files with 412 additions and 97 deletions

View File

@@ -53,8 +53,9 @@ public class AddServerViewModel : MyReactiveObject
[Reactive]
public string WgPublicKey { get; set; }
//[Reactive]
//public string WgPresharedKey { get; set; }
[Reactive]
public string WgPresharedKey { get; set; }
[Reactive]
public string WgInterfaceAddress { get; set; }
@@ -159,17 +160,8 @@ public class AddServerViewModel : MyReactiveObject
switch (SelectedSource.GetNetwork())
{
case nameof(ETransport.raw):
Host = value;
break;
case nameof(ETransport.ws):
Host = value;
break;
case nameof(ETransport.httpupgrade):
Host = value;
break;
case nameof(ETransport.xhttp):
Host = value;
break;
@@ -202,13 +194,7 @@ public class AddServerViewModel : MyReactiveObject
break;
case nameof(ETransport.ws):
Path = value;
break;
case nameof(ETransport.httpupgrade):
Path = value;
break;
case nameof(ETransport.xhttp):
Path = value;
break;
@@ -303,6 +289,7 @@ public class AddServerViewModel : MyReactiveObject
VlessEncryption = protocolExtra.VlessEncryption?.IsNullOrEmpty() == false ? protocolExtra.VlessEncryption : Global.None;
SsMethod = protocolExtra.SsMethod ?? string.Empty;
WgPublicKey = protocolExtra.WgPublicKey ?? string.Empty;
WgPresharedKey = protocolExtra.WgPresharedKey ?? string.Empty;
WgInterfaceAddress = protocolExtra.WgInterfaceAddress ?? string.Empty;
WgReserved = protocolExtra.WgReserved ?? string.Empty;
WgMtu = protocolExtra.WgMtu ?? 1280;
@@ -401,6 +388,7 @@ public class AddServerViewModel : MyReactiveObject
VlessEncryption = VlessEncryption.NullIfEmpty(),
SsMethod = SsMethod.NullIfEmpty(),
WgPublicKey = WgPublicKey.NullIfEmpty(),
WgPresharedKey = WgPresharedKey.NullIfEmpty(),
WgInterfaceAddress = WgInterfaceAddress.NullIfEmpty(),
WgReserved = WgReserved.NullIfEmpty(),
WgMtu = WgMtu >= 576 ? WgMtu : null,