public ProxyHttpRequestSelector(ProxySelector selector, IHttpWire wire) : base(wire) { _selector = selector; _selectorCopy = new HttpProxySelector(selector.FetchProxies()); _error = new Stack<AttemptPair>(); }
public ProxyHttpRequestSelector(ProxySelector selector, string url) : base(url) { _selector = selector; _selectorCopy = new HttpProxySelector(selector.FetchProxies()); _error = new Stack <AttemptPair>(); }
public ProxyHttpRequestSelector(ProxySelector selector, IHttpWire wire) : base(wire) { _selector = selector; _selectorCopy = new HttpProxySelector(selector.FetchProxies()); _error = new Stack <AttemptPair>(); }
public ProxySelectorImpl(ProxySelector selector) { _selector = selector; }
public static IHttpRequestFactory CreateProxySelector(ProxySelector selector) { return(new ProxySelectorImpl(selector)); }
public static IHttpRequestFactory CreateProxySelector(ProxySelector selector) { return new ProxySelectorImpl(selector); }
protected void InitProxies() { TotalOperations += Proxies.Length; if (Proxies.Length > 0) { var selector = new ProxySelector(); foreach (var proxyString in Proxies) { var proxy = Proxy.FromString(proxyString); RequestFactory = HttpRequestFactory.CreateProxyFactory(proxy); if (TestProxy()) { Log.InfoFormat("Proxy added, Proxy={0}", proxy); selector.Add(proxy); } else Log.InfoFormat("Proxy failed, Proxy={0}", proxy); OnProgress(); } if (selector.ProxyCount == 0) { Log.Info("No poxies pass test. Fail."); Thread.CurrentThread.Abort(); } RequestFactory = HttpRequestFactory.CreateProxySelector(selector); } }