pub fn format_host(ip: IpAddr) -> String
Wrap IPv6 literals in brackets so they can go in a URL authority.