Proxy Rotation
odirscan distributes scan requests across multiple Mullvad SOCKS5 proxies using colly's round-robin proxy switcher.
How It Works
During scanner initialization:
SelectProxies()returns a list of SOCKS5 proxy URLs (up toProxyCount, default 50).- These are passed to colly's
proxy.RoundRobinProxySwitcher(), which creates a function that cycles through proxies on each request. - The proxy function is set on the colly collector via
SetProxyFunc().
Each HTTP request made by colly (both during Scan and Tag phases) uses the next proxy in the rotation.
Configuration
| Field | Default | Effect |
|---|---|---|
ScannerConfig.ProxyCount | 50 | Maximum number of proxies in the rotation pool |
ScannerConfig.MaxRelayWeight | 99 | Excludes relays with weight above this value |
MullvadConfig.ProxyPort | 1080 | SOCKS5 port on each relay |
Benefits
- IP diversity -- Requests originate from many different exit IPs, reducing the chance of rate limiting.
- Geographic distribution -- Relays span multiple countries and cities.
- Automatic failover -- colly handles connection errors; the next request simply uses the next proxy in the rotation.
Concurrency
The scanner runs with colly.Async(true) and a configurable parallelism limit (default 32 concurrent requests). Combined with proxy rotation, this means up to 32 requests may be in flight simultaneously across different proxies.