Make localhost special-case actually aware of IPv4 vs IPv6.