Skip to main content

resolve_to_ips

Function resolve_to_ips 

Source
pub fn resolve_to_ips(hostname: &str) -> Vec<IpAddr>
Expand description

Resolve a hostname to a Vec<IpAddr>, with an IP-literal fast path.

If hostname parses as an IP literal, returns vec![that_ip] without touching the worker pool or the cache. Otherwise falls back to resolve(hostname) and parses each returned string.

This is the preferred entry point for any caller that’s going to build SocketAddrs from the result (TCP connect, UDP send-to, HTTP SSRF validation). Returns an empty Vec on resolution failure.