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) : this(File.ReadLines(file), false, new ProxyJudgeService()) { }