C# Class BetterHttpClient.ProxyManager

ファイルを表示 Open project: Yozer/BetterHttpClient

Public Methods

Method Description
DownloadBytes ( string url, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]

Downloads url using GET.

DownloadBytes ( string url, NameValueCollection data, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]

Downloads url using POST.

GetAllProxies ( ) : List

Return all proxies

GetAvalibleProxy ( ) : Proxy

Returns first free (but busy) and working proxy.

GetPage ( string url, string requiredString = null, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : string

Downloads url using GET.

PostPage ( string url, NameValueCollection data, string requiredString = null, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : string

Downloads url using POST.

ProxyManager ( IEnumerable proxies, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService proxyJudgeService ) : System
ProxyManager ( IEnumerable proxies, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService proxyJudgeService ) : System
ProxyManager ( string file ) : System
ProxyManager ( string file, bool anonymousOnly ) : System
ProxyManager ( string file, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService service ) : System
SetAllProxyAsOnline ( ) : void

Sets all proxies IsOnline property to true.

Private Methods

Method Description
CloneProxyList ( List proxyInput ) : List
CreateHttpClient ( NameValueCollection customHeaders = null ) : HttpClient
DownloadBytes ( string url, NameValueCollection data, Proxy proxy, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]
ParseProxies ( IEnumerable proxies ) : IEnumerable

Method Details

DownloadBytes() public method

Downloads url using GET.
Page has returned 404 not found
public DownloadBytes ( string url, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]
url string
cookies System.Net.CookieContainer
customHeaders System.Collections.Specialized.NameValueCollection Specify custom headers for this request
return byte[]

DownloadBytes() public method

Downloads url using POST.
Page has returned 404 not found
public DownloadBytes ( string url, NameValueCollection data, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : byte[]
url string Url of webpage
data System.Collections.Specialized.NameValueCollection Post values
cookies System.Net.CookieContainer Cookies for request. Left null if you don't want to use cookies
customHeaders System.Collections.Specialized.NameValueCollection Specify custom headers for this request
return byte[]

GetAllProxies() public method

Return all proxies
public GetAllProxies ( ) : List
return List

GetAvalibleProxy() public method

Returns first free (but busy) and working proxy.
All proxies are banned. You can't make request.
public GetAvalibleProxy ( ) : Proxy
return Proxy

GetPage() public method

Downloads url using GET.
Page has returned 404 not found
public GetPage ( string url, string requiredString = null, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : string
url string Url of webpage
requiredString string
cookies System.Net.CookieContainer Cookies for request. Left null if you don't want to use cookies
customHeaders System.Collections.Specialized.NameValueCollection Specify custom headers for this request
return string

PostPage() public method

Downloads url using POST.
Page has returned 404 not found
public PostPage ( string url, NameValueCollection data, string requiredString = null, CookieContainer cookies = null, NameValueCollection customHeaders = null ) : string
url string Url of webpage
data System.Collections.Specialized.NameValueCollection Post values
requiredString string
cookies System.Net.CookieContainer Cookies for request. Left null if you don't want to use cookies
customHeaders System.Collections.Specialized.NameValueCollection Specify custom headers for this request
return string

ProxyManager() public method

public ProxyManager ( IEnumerable proxies, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService proxyJudgeService ) : System
proxies IEnumerable Proxy list
anonymousOnly bool Set true if you want to filter proxy list and use only anonymous only
proxyJudgeService BetterHttpClient.CheckService.ProxyJudgeService Proxy judge service is used to determine proxy anonymity level
return System

ProxyManager() public method

public ProxyManager ( IEnumerable proxies, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService proxyJudgeService ) : System
proxies IEnumerable Proxy list
anonymousOnly bool Set true if you want to filter proxy list and use only anonymous only
proxyJudgeService BetterHttpClient.CheckService.ProxyJudgeService Proxy judge service is used to determine proxy anonymity level
return System

ProxyManager() public method

public ProxyManager ( string file ) : System
file string
return System

ProxyManager() public method

public ProxyManager ( string file, bool anonymousOnly ) : System
file string
anonymousOnly bool
return System

ProxyManager() public method

public ProxyManager ( string file, bool anonymousOnly, BetterHttpClient.CheckService.ProxyJudgeService service ) : System
file string
anonymousOnly bool
service BetterHttpClient.CheckService.ProxyJudgeService
return System

SetAllProxyAsOnline() public method

Sets all proxies IsOnline property to true.
public SetAllProxyAsOnline ( ) : void
return void