Configuration
odirscan uses three configuration structs, each with a Default*() constructor that provides sensible defaults. All fields are public and can be set programmatically.
ScannerConfig
Controls the crawling and filtering behavior.
| Field | Type | Default | Description |
|---|---|---|---|
Parallelism | int | 32 | Number of concurrent HTTP requests |
RequestTimeout | time.Duration | 15s | Per-request HTTP timeout |
ProxyCount | int | 50 | Maximum number of Mullvad proxies to select |
MaxRelayWeight | int | 99 | Upper bound (inclusive) for relay weight filter |
SkipMimeTypePrefixes | []string | image, font, text/css, audio, video | MIME type prefixes whose files are excluded from findings |
SkipSubdirKeywords | []string | .git, .svn, .hg, node_modules, bower_components, venv, vendor, __pycache__, site-packages, .cache, .idea | Substrings that cause a subdirectory to be skipped |
cfg := config.DefaultScannerConfig()
cfg.Parallelism = 64
cfg.RequestTimeout = 30 * time.Second
MullvadConfig
Controls the Mullvad relay list and proxy settings.
| Field | Type | Default | Description |
|---|---|---|---|
RelayURL | string | https://api.mullvad.net/public/relays/wireguard/v2 | Mullvad relay list API endpoint |
DataFile | string | relays.json | Path to the cached relay list on disk |
MetaFile | string | relays.meta.json | Path to the cached relay metadata on disk |
ProxyPort | int | 1080 | SOCKS5 port on Mullvad relay hosts |
UpdateInterval | time.Duration | 1h | How often to refresh the relay list |
cfg := config.DefaultMullvadConfig()
cfg.UpdateInterval = 30 * time.Minute
WebConfig
Controls the web server.
| Field | Type | Default | Description |
|---|---|---|---|
ListenAddr | string | :8080 | TCP address to listen on |
cfg := config.DefaultWebConfig()
cfg.ListenAddr = ":3000"