Exemplo n.º 1
0
        private static void Run(Appsettings settings)
        {
            var logger = new ConsoleLogger();
            var server = new FastTunnelServer(settings.ServerSettings, logger);

            server.Run();

            while (true)
            {
                Thread.Sleep(10000 * 60);
            }
        }
        public Task StartAsync(CancellationToken cancellationToken)
        {
            _logger.LogInformation("===== FastTunnel Server Starting =====");

            try
            {
                _fastTunnelServer.Run();
            }
            catch (Exception ex)
            {
                // NLog: catch any exception and log it.
                _logger.LogError(ex, "Server Error");
                Console.WriteLine(ex);
            }

            return(Task.CompletedTask);
        }
Exemplo n.º 3
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            return(Task.Run(() =>
            {
                FastTunnelGlobal.AddFilter(_authenticationFilter);

                try
                {
                    _server.Run();
                }
                catch (Exception ex)
                {
                    // NLog: catch any exception and log it.
                    _logger.LogError(ex, "Server Error");
                    Console.WriteLine(ex);
                }
            }, cancellationToken));
        }
        public Task StartAsync(CancellationToken cancellationToken)
        {
            _logger.LogInformation("===== FastTunnel Server Starting =====");

            _fastTunnelServer = new FastTunnelServer(_logger, _configuration.Get <AppSettings>().ServerSettings);
            FastTunnelGlobal.AddFilter(_authenticationFilter);

            try
            {
                _fastTunnelServer.Run();

                _logger.LogDebug("Server Run Success");
            }
            catch (Exception ex)
            {
                // NLog: catch any exception and log it.
                _logger.LogError(ex, "Server Error");
                Console.WriteLine(ex);
            }

            return(Task.CompletedTask);
        }
Exemplo n.º 5
0
 private void Run()
 {
     _fastTunnelServer.Run();
 }
 private void Run()
 {
     _fastTunnelServer.Run(_configuration.Get <Appsettings>().ServerSettings);
 }