Documentation
¶
Overview ¶
Package proxy provides proxy IP pool management and online filtering.
Index ¶
Constants ¶
View Source
const ( CONN_TIMEOUT = 4 //4s DAIL_TIMEOUT = 4 //4s TRY_TIMES = 3 // Max concurrency for IP speed testing MAX_THREAD_NUM = 1000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
Proxy manages a pool of proxy IPs with online filtering and per-host sorting.
func New ¶
func New() *Proxy
New creates and starts a Proxy that loads and filters proxy IPs from config.
func (*Proxy) SetSurfForTest ¶ added in v1.4.0
SetSurfForTest injects a Surfer for testing.
func (*Proxy) Update ¶
func (p *Proxy) Update() result.VoidResult
Update refreshes the proxy IP list.
func (*Proxy) UpdateTicker ¶
UpdateTicker updates the ticker.
type ProxyForHost ¶
ProxyForHost manages proxy IPs for a host, sorted by response time.
func (*ProxyForHost) Less ¶
func (ph *ProxyForHost) Less(i, j int) bool
func (*ProxyForHost) Swap ¶
func (ph *ProxyForHost) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.