more robust hostname:port treatment