internal CloudflareIpUpdater(ILogger <CloudflareIpUpdater> logger, IAutoProxyStore proxyStore, IOptionsMonitor <CloudflareUpdaterOptions> options, HttpClient httpClient) { _logger = logger; _proxyStore = proxyStore; _options = options; _httpClient = httpClient; }
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()); }
public void AddRanges(IAutoProxyStore store) { store.ReplaceRanges(_service, _ranges); }