* 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
@@ -258,13 +258,14 @@ public partial class CoreConfigV2rayService
var peer = new WireguardPeer4Ray
{
publicKey = protocolExtra.WgPublicKey ?? "",
endpoint = address + ":" + _node.Port.ToString()
endpoint = address + ":" + _node.Port.ToString(),
preSharedKey = protocolExtra.WgPresharedKey,
};
var setting = new Outboundsettings4Ray
{
address = Utils.String2List(protocolExtra.WgInterfaceAddress),
address = Utils.String2List(protocolExtra.WgInterfaceAddress)?.Select(s => s.Trim()).ToList() ?? ["172.16.0.2/32"],
secretKey = _node.Password,
reserved = Utils.String2List(protocolExtra.WgReserved)?.Select(int.Parse).ToList(),
reserved = Utils.String2List(protocolExtra.WgReserved)?.Select(s => s.Trim()).Select(int.Parse).ToList(),
mtu = protocolExtra.WgMtu > 0 ? protocolExtra.WgMtu : Global.TunMtus.First(),
peers = [peer]
};