Documentation
¶
Overview ¶
Package proxy parses proxy list files and hands proxies out to workers.
It is the modernized replacement for solar2-core's proxies package: Parse now returns descriptive errors (the old one returned errors.New("")) and accepts every common list format instead of just two.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool hands proxies out to workers. Unlike input.Queue it never empties: Next round-robins forever and Random samples with replacement, which matches how proxies are actually used (rotate across many attempts). All methods are safe for concurrent use.
type Proxy ¶
Proxy is a single parsed proxy endpoint. Username/Password are empty for unauthenticated proxies. Scheme is "" when the source line carried no scheme (host:port[:user:pass] shorthand).
func Parse ¶
Parse accepts the common proxy list formats and returns a descriptive error on failure:
host:port host:port:user:pass user:pass@host:port host:port@user:pass scheme://host:port scheme://user:pass@host:port
func ParseLines ¶
ParseLines parses each line, silently skipping ones that don't parse. Use Parse directly when you want to know why a line was rejected.