Esempio n. 1
0
 internal CloudflareIpUpdater(ILogger <CloudflareIpUpdater> logger, IAutoProxyStore proxyStore, IOptionsMonitor <CloudflareUpdaterOptions> options, HttpClient httpClient)
 {
     _logger     = logger;
     _proxyStore = proxyStore;
     _options    = options;
     _httpClient = httpClient;
 }
Esempio n. 2
0
        public AutoProxyMiddleware(ILoggerFactory loggerFactory, IOptionsMonitor <AutoProxyOptions> options, RequestDelegate next, IAutoProxyStore autoProxyStore)
        {
            _logger         = loggerFactory.CreateLogger <AutoProxyMiddleware>();
            _loggerFactory  = loggerFactory;
            _options        = options;
            _next           = next ?? throw new ArgumentNullException(nameof(next));
            _autoProxyStore = autoProxyStore;

            // Register event handlers
            _options.OnChange(_ => OnIpRangesUpdate());
            autoProxyStore.OnIpRangesUpdate += OnIpRangesUpdate;

            ReplaceKnownProxies(autoProxyStore.GetRanges());
        }
Esempio n. 3
0
 public void AddRanges(IAutoProxyStore store)
 {
     store.ReplaceRanges(_service, _ranges);
 }