Skip to main content

Module net

Module net 

Source
Expand description

Network utilities for tool crates.

Shared SSRF and domain-policy primitives used by every outbound-network tool (scrape.rs, search/). Centralizing these here means new HTTP-based tools get the same URL-scheme, private-IP, and allow/deny-list enforcement without re-implementing it.

Functionsยง

check_domain_policy
Check host against a domain allowlist/denylist pair.
is_private_host
Returns true when host is a loopback/private-range IP literal or a reserved .localhost/.internal/.local domain.
is_private_ip
Returns true if addr is a non-routable or private IP address that should be blocked for outbound connections (SSRF defense).
validate_url
Validate that raw is an HTTPS URL pointing at a non-private host.