pub(crate) async fn lookup_host_with_cache(
context: &Context,
hostname: &str,
port: u16,
alpn: &str,
load_cache: bool,
) -> Result<Vec<SocketAddr>>
Expand description
Looks up hostname and port using DNS and updates the address resolution cache.
alpn
is used to sort DNS results by the time we have successfully
connected to the IP address using given alpn
.
If result sorting is not needed or alpn
is unknown,
pass empty string here, e.g. for HTTP requests
or when resolving the IP address of SOCKS proxy.
If load_cache
is true, appends cached results not older than 30 days to the end
or entries from fallback cache if there are no cached addresses.