Esempio n. 1
0
    public TcpIpHostDataJsonSafe(EnsureSpecial getThisHostInfo, bool once)
    {
        TcpIpSystemHostInfo info = LocalNet.GetHostInfo(once);

        this.HostName        = info.HostName;
        this.DomainName      = info.DomainName;
        this.FqdnHostName    = info.FqdnHostName;
        this.IsIPv4Supported = info.IsIPv4Supported;
        this.IsIPv6Supported = info.IsIPv6Supported;
        this.IPAddressList   = info.IPAddressList.Select(x => x.ToString()).ToArray();
    }
Esempio n. 2
0
        public CertVaultSettings(EnsureSpecial defaultSetting)
        {
            this.UseAcme = CoresConfig.CertVaultSettings.DefaultUseAcme;
            this.AcmeServiceDirectoryUrl = AcmeDefaultUrl;
            this.ReloadIntervalMsecs     = CoresConfig.CertVaultSettings.DefaultReloadInterval;
            this.AcmeContactEmail        = GenDefaultContactEmail();
            this.AcmeEnableFqdnIpCheck   = true;
            this.NonAcmeEnableAutoGenerateSubjectNameCert = true;
            this.MaxAcmeCerts = CoresConfig.CertVaultSettings.DefaultMaxAcmeCerts;

            Normalize();
        }
Esempio n. 3
0
    public TcpListenParam(EnsureSpecial compatibleWithKestrel, NetTcpListenerAcceptedProcCallback?acceptCallback, IPEndPoint endPoint, string?rateLimiterConfigName = null)
    {
        List <IPEndPoint> ret = new List <IPEndPoint>();

        if (endPoint.Address == IPAddress.IPv6Any)
        {
            ret.Add(new IPEndPoint(IPAddress.Any, endPoint.Port));
            ret.Add(new IPEndPoint(IPAddress.IPv6Any, endPoint.Port));
        }
        else
        {
            ret.Add(endPoint);
        }

        this.EndPointsList         = ret;
        this.AcceptCallback        = acceptCallback;
        this.RateLimiterConfigName = rateLimiterConfigName;
    }
Esempio n. 4
0
    public TcpListenParam(EnsureSpecial isRandomPortMode, NetTcpListenerAcceptedProcCallback?acceptCallback = null, AddressFamily family = AddressFamily.InterNetwork, IPAddress?address = null)
    {
        this.EndPointsList               = new IPEndPoint[0];
        this.AcceptCallback              = acceptCallback;
        this.IsRandomPortMode            = true;
        this.RandomPortModeAddressFamily = family;
        if (address == null)
        {
            if (family == AddressFamily.InterNetwork)
            {
                address = IPAddress.Any;
            }
            else if (family == AddressFamily.InterNetworkV6)
            {
                address = IPAddress.IPv6Any;
            }
            else
            {
                throw new ArgumentOutOfRangeException(nameof(family));
            }
        }

        this.RandomPortListenAddress = address;
    }
 public HttpServerSimpleBasicAuthDatabase(EnsureSpecial withRandom)
 {
     this.UsernameAndPassword.Add("user1", Str.GenRandPassword());
     this.UsernameAndPassword.Add("user2", Str.GenRandPassword());
 }
Esempio n. 6
0
 public HttpServerSimpleBasicAuthDatabase(EnsureSpecial createInitialAdminUsers)
 {
     CoresConfig.HttpServerSimpleBasicAuthDatabaseConfig.InitAuthDatabaseUsernameAndPasswordCallback.Value(this);
 }