Пример #1
0
        /// <summary>
        /// Returns true if proxy can hide your ip address
        /// </summary>
        public bool IsAnonymous(ProxyJudgeService service)
        {
            if (_isChecked)
            {
                return(_isAnonymous);
            }

            _isAnonymous = service.IsProxyAnonymous(this);
            _isChecked   = true;
            IsOnline     = _isAnonymous;
            return(_isAnonymous);
        }
Пример #2
0
 /// <param name="proxies">Proxy list</param>
 /// <param name="anonymousOnly">Set true if you want to filter proxy list and use only anonymous only</param>
 /// <param name="proxyJudgeService">Proxy judge service is used to determine proxy anonymity level</param>
 /// <exception cref="ArgumentNullException"></exception>
 public ProxyManager(IEnumerable <Proxy> proxies, bool anonymousOnly, ProxyJudgeService proxyJudgeService)
 {
     if (proxies == null || proxyJudgeService == null)
     {
         throw new ArgumentNullException();
     }
     foreach (Proxy proxy in proxies)
     {
         try
         {
             _proxies.Add(proxy);
         }
         catch (UriFormatException)
         {
             // parsing exception
         }
     }
     AnonymousProxyOnly                  = anonymousOnly;
     _proxyJudgeService                  = proxyJudgeService;
     _numberOfAttemptsPerRequest         = _proxies.Count + 1;
     _proxyJudgeService.NumberOfAttempts = _numberOfAttempts;
 }
Пример #3
0
 public ProxyManager(string file, bool anonymousOnly, ProxyJudgeService service) : this(File.ReadLines(file), anonymousOnly, service)
 {
 }
Пример #4
0
 /// <param name="proxies">Proxy list</param>
 /// <param name="anonymousOnly">Set true if you want to filter proxy list and use only anonymous only</param>
 /// <param name="proxyJudgeService">Proxy judge service is used to determine proxy anonymity level</param>
 /// <exception cref="ArgumentNullException"></exception>
 public ProxyManager(IEnumerable <string> proxies, bool anonymousOnly, ProxyJudgeService proxyJudgeService) :
     this(ParseProxies(proxies), anonymousOnly, proxyJudgeService)
 {
 }