/// <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; }
/// <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; }
public ProxyManager(string file, bool anonymousOnly, ProxyJudgeService service) : this(File.ReadLines(file), anonymousOnly, service) { }
/// <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) { }