using XFEExtension.NetCore.CyberComm;
namespace XFEExtension.NetCore.ServerInteractive.Options;
///
/// XFE服务器核心选项
///
public class XFEServerCoreOptions
{
///
/// 绑定的IP地址(服务初始化执行完成后才会刷新)
///
public List BindingIPAddress { get; set; } = [];
///
/// 核心服务器名称
///
public string ServerCoreName { get; set; } = string.Empty;
///
/// 是否接收非标准的Json字符串,默认为true
///
public bool AcceptNonStandardJson { get; set; } = true;
///
/// 是否接收GET请求
///
public bool AcceptGet { get; set; } = false;
///
/// 是否接收POST请求
///
public bool AcceptPost { get; set; } = true;
///
/// 获取IP地址的函数,默认为从请求事件参数中获取客户端IP地址
///
public Func GetIPFunction { get; set; } = args => args.ClientIP;
///
/// 主入口点路径(ServerCore主要入口点),默认为空字符串(为空时直接使用次级入口点)。
/// 多个核心服务器绑定同一端口时,使用不同的主入口点区分核心服务器。
///
public string MainEntryPoint { get; set; } = string.Empty;
/// CyberComm 连接、请求和消息限制。
public CyberCommLimitOptions TransportLimits { get; set; } = new();
/// HTTPS/WSS TLS 证书配置;仅 HTTP 时可为空。
public CyberCommTlsOptions? Tls { get; set; }
///
/// 绑定IP地址
///
///
///
public XFEServerCoreOptions BindIP(string ipAddress)
{
BindingIPAddress.Add(ipAddress);
return this;
}
}