Function guess_local_url

Source
pub fn guess_local_url(s: impl AsRef<str>) -> bool
Expand description

Guess whether the URL is local, based on the hostname or IP.

Best-effort heuristic: returns true if the connection has no hostname, or the host is localhost, 127.0.0.1, or the IPv6 loopback ::1.