示例#1
0
        public void Start()
        {
            Stop();

            startTime = DateTime.Now;

            X509Certificate2 cert = null;

            if (!string.IsNullOrWhiteSpace(cfg.certificate_pfx_path) && File.Exists(cfg.certificate_pfx_path))
            {
                if (!string.IsNullOrEmpty(cfg.certificate_pfx_password))
                {
                    cert = new X509Certificate2(cfg.certificate_pfx_path, cfg.certificate_pfx_password);
                }
                else
                {
                    cert = new X509Certificate2(cfg.certificate_pfx_path);
                }
            }
            httpServer              = new MJpegServer(cfg.webport, cfg.webport_https, cert);
            httpServer.SocketBound += Server_SocketBound;
            httpServer.CertificateExpirationWarning += HttpServer_CertificateExpirationWarning;
            httpServer.Start();

            webSocketServer              = new CameraProxyWebSocketServer(cfg.webSocketPort, cfg.webSocketPort_secure, cert);
            webSocketServer.SocketBound += Server_SocketBound;
            webSocketServer.Start();

            thrCertificateMaintainer              = new Thread(maintainLetsEncryptCertificate);
            thrCertificateMaintainer.Name         = "Maintain LetsEncrypt Certificate";
            thrCertificateMaintainer.IsBackground = true;
            thrCertificateMaintainer.Start();
        }
示例#2
0
        public void Start()
        {
            Stop();

            startTime = DateTime.Now;

            httpServer = new MJpegServer(cfg.webport, cfg.webport_https);
            httpServer.Start();

            webSocketServer = new CameraProxyWebSocketServer(cfg.webSocketPort, cfg.webSocketPort_secure);
            webSocketServer.Start();
        }