예제 #1
0
        void IProxyProvider.SetProxyUnavailable(LuminatiProxyModel proxy, string reason)
        {
            var proxiesCount = _proxyList.Count;
            var seconds      = proxiesCount * AverageDuration;

            proxy.Freeze(TimeSpan.FromSeconds(seconds));
            _logger.Info($"LuminatiProxyModel {proxy.CountryCode} will blocked till {proxy.FreezeTime}. Count of blocked:{GetUnAvailableProxyList().Count}({_proxyList.Count}). Reason: {reason}");
        }
예제 #2
0
        private LuminatiProxyModel GetProxy()
        {
            var proxyList = GetAvailableProxyList();

            if (GetAvailableProxyList().Any())
            {
                var rand = new Random();
                _currentProxy = proxyList[rand.Next(proxyList.Count)];
                return(_currentProxy);
            }

            return(null);
        }