Versions in this module Expand all Collapse all v1 v1.0.1 Oct 21, 2020 Changes in this version + const DefaultHTTPTimeout + const DefaultMaxRetryTimes + const DefaultWaitInterval + const ProxyPoolOptionCountry_domestic + const ProxyPoolOptionCountry_foreign + var DistantFuture = time.Hour * 24 * 365 * 100 + var ErrFirewallDeny = errors.New("proxypool: Firewall denied access") + var ErrIllegalBody = errors.New("proxypool: Body contains illegal substr") + var ErrIllegalURL = errors.New("proxypool: URL contains illegal substr") + var ErrNotFound = errors.New("proxypool: Not found a useful proxy url") + var ErrTimeout = errors.New("proxypool: Connection timeout") + func IsConnectionErr(err error) bool + func IsTimeoutErr(err error) bool + type PostHandler func(*http.Response, io.Reader) error + func WithBodyContains(substr string) PostHandler + func WithURLContains(substr string) PostHandler + type PreHandler func(*http.Request) error + type ProxyPool struct + func NewPool(opt ProxyPoolOption) (*ProxyPool, error) + func (p *ProxyPool) Close() + func (p *ProxyPool) Dirty(item *url.URL, wait time.Duration) + func (p *ProxyPool) Do(req *http.Request) (resp *http.Response, err error) + func (p *ProxyPool) NewClient() (cli *http.Client, purl *url.URL, err error) + func (p *ProxyPool) ProxyURL() (*url.URL, error) + func (p *ProxyPool) WithPostHandle(hdls ...PostHandler) *ProxyPool + func (p *ProxyPool) WithPreHandle(hdls ...PreHandler) *ProxyPool + func (p *ProxyPool) WithRetryTimes(times int) *ProxyPool + func (p *ProxyPool) WithTimeout(timeout time.Duration) *ProxyPool + func (p *ProxyPool) WithWaitInterval(interval time.Duration) *ProxyPool + type ProxyPoolOption struct + Area string + Count int + Country string + PoolURL string + Transparent bool + UseHttps bool + func (opt *ProxyPoolOption) URL() *url.URL