mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
20 lines
926 B
C#
20 lines
926 B
C#
using Netch.Forms;
|
|
|
|
namespace Netch.Servers;
|
|
|
|
[Fody.ConfigureAwait(true)]
|
|
public class WireGuardForm : ServerForm
|
|
{
|
|
public WireGuardForm(WireGuardServer? server = default)
|
|
{
|
|
server ??= new WireGuardServer();
|
|
Server = server;
|
|
CreateTextBox("LocalAddresses", "Local Addresses", s => true, s => server.LocalAddresses = s, server.LocalAddresses);
|
|
CreateTextBox("PeerPublicKey", "Public Key", s => true, s => server.PeerPublicKey = s, server.PeerPublicKey);
|
|
CreateTextBox("PrivateKey", "Private Key", s => true, s => server.PrivateKey = s, server.PrivateKey);
|
|
CreateTextBox("PreSharedKey", "PSK", s => true, s => server.PreSharedKey = s, server.PreSharedKey);
|
|
CreateTextBox("MTU", "MTU", s => int.TryParse(s, out _), s => server.MTU = int.Parse(s), server.MTU.ToString(), 76);
|
|
}
|
|
|
|
protected override string TypeName { get; } = "WireGuard";
|
|
} |