Documentation ¶
Index ¶
- func DomainOf(url string) (domain string)
- func GetTransport(ps *types.ProxyServer, insecureSkipVerify bool) (transport *http.Transport, e error)
- func HTTPGet(link string, headers map[string]string, px *types.ProxyServer, ...) (res *http.Response, e error)
- func HTTPGetResponse(link string, headers map[string]string, useMasterProxy, rotateAgent bool) (res *http.Response, e error)
- func PickProxy() (proxy *types.ProxyServer, e error)
- func UpdateProxyScore(p *types.ProxyServer, success bool)
- func UpdateProxyScoreGlobal(p *types.ProxyServer, success bool)
- func ValidateProxy(ps *types.ProxyServer, probeTimeout int) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTransport ¶ added in v0.1.3
func HTTPGet ¶
func HTTPGet(link string, headers map[string]string, px *types.ProxyServer, timeout, maxTimeout time.Duration, cookies ...*http.Cookie) (res *http.Response, e error)
HTTPGet initiates HTTP get request and returns its response
func HTTPGetResponse ¶
func HTTPGetResponse(link string, headers map[string]string, useMasterProxy, rotateAgent bool) (res *http.Response, e error)
HTTPGetResponse initiates HTTP get request and returns its response
func PickProxy ¶
func PickProxy() (proxy *types.ProxyServer, e error)
PickProxy randomly chooses a proxy from database.
func UpdateProxyScore ¶
func UpdateProxyScore(p *types.ProxyServer, success bool)
UpdateProxyScore for the specified proxy.
func UpdateProxyScoreGlobal ¶
func UpdateProxyScoreGlobal(p *types.ProxyServer, success bool)
UpdateProxyScoreGlobal updates globa score for the specified proxy.
func ValidateProxy ¶
func ValidateProxy(ps *types.ProxyServer, probeTimeout int) bool
ValidateProxy checks the status of remote listening port, and further checks if it's a valid proxy server by calling 3rd-party services that return source IP for validation. Note that some of the 3rd-party proxy may further relay the request to downstream nodes, therefore as long as the returned IP address is not the same as our exposed external IP, It will be considered a qualified proxy server at this point.
Types ¶
This section is empty.