private static bool ValidateUrlDetectOpt(NgrokOptions opt)
 {
     if (opt.DetectUrl == false && string.IsNullOrWhiteSpace(opt.ApplicationHttpUrl))
     {
         return(false);
     }
     return(true);
 }
 private static void PostConfigure(NgrokOptions opt)
 {
     if (opt.ManageNgrokProcess == false)
     {
         opt.DownloadNgrok         = false;
         opt.RedirectLogs          = false;
         opt.NgrokConfigProfile    = null;
         opt.ProcessStartTimeoutMs = 0;
     }
 }
Exemplo n.º 3
0
        public NgrokHostedService(
            IOptionsMonitor <NgrokOptions> optionsMonitor,
            ILogger <NgrokHostedService> logger,
            NgrokDownloader nGrokDownloader,
            IServer server,
            IApplicationLifetime applicationLifetime,
            NgrokProcessMgr processMgr,
            INgrokApiClient client)
        {
            _logger              = logger;
            _options             = optionsMonitor.CurrentValue;
            _nGrokDownloader     = nGrokDownloader;
            _server              = server;
            _applicationLifetime = applicationLifetime;
            _processMgr          = processMgr;
            _client              = client;

            _tunnelTaskSource        = new TaskCompletionSource <IReadOnlyCollection <Tunnel> >();
            _serverAddressesSource   = new TaskCompletionSource <IReadOnlyCollection <string> >();
            _shutdownSource          = new TaskCompletionSource <bool>();
            _cancellationTokenSource = new CancellationTokenSource();
        }