pub async fn resolve(host: &str, port: u16) -> Result<Vec<SocketAddr>>Expand description
Resolves host/port to a non-empty list of socket addresses.
Unbudgeted — this takes no slot from the D90 lookup budget, so nothing a
client controls may reach it: a tunnel target resolves through
ConnectionResolver::lookup or not at all. What keeps this pub is the
tests (it_resolver_pool proves its injected resolver took hold by watching
this very function hang).
An IP literal resolves to itself without consulting the resolver, and an IPv6
one is written bare: the brackets belong to the syntax a target arrived in,
and each of the two places a target arrives has already taken them off –
tunnel::tcp splitting an RFC 3986 authority, tunnel::udp decoding an
RFC 9298 template, which carries them bare to begin with. Stripping them here
as well would mean accepting a host neither of those produced, and answering
example.com]:443 by dialling example.com.