Changed it so it detects http://localhost (eg an address with no domain)