Files
netch/Netch/Servers/VLESS/VLESSForm/VLESSForm.cs
2020-10-21 21:34:28 +08:00

60 lines
2.0 KiB
C#

using System.Collections.Generic;
using Netch.Forms;
namespace Netch.Servers.VLESS.VLESSForm
{
class VLESSForm : ServerForm
{
protected override string TypeName { get; } = "VLESS";
public VLESSForm(VLESS server = default)
{
server ??= new VLESS();
Server = server;
CreateTextBox("UUID", "UUID",
s => true,
s => server.UserID = s,
server.UserID);
CreateTextBox("EncryptMethod", "Encrypt Method",
s => true,
s => server.EncryptMethod = !string.IsNullOrWhiteSpace(s) ? s : "none",
server.EncryptMethod);
CreateTextBox("Flow", "Flow",
s => true,
s => server.Flow = s,
server.Flow);
CreateComboBox("TransferProtocol", "Transfer Protocol",
VLESSGlobal.TransferProtocols,
s => server.TransferProtocol = s,
server.TransferProtocol);
CreateComboBox("FakeType", "Fake Type",
VLESSGlobal.FakeTypes,
s => server.FakeType = s,
server.FakeType);
CreateTextBox("Host", "Host",
s => true,
s => server.Host = s,
server.Host);
CreateTextBox("Path", "Path",
s => true,
s => server.Path = s,
server.Path);
CreateComboBox("TLSSecure", "TLS Secure",
new List<string> {"", "true", "false"},
s =>
{
server.TLSSecure = s switch
{
"" => null,
"true" => true,
"false" => false,
_ => null
};
},
server.TLSSecure?.ToString() ?? string.Empty);
CreateCheckBox("UseMux", "Use Mux",
b => server.UseMux = b,
server.UseMux);
}
}
}