Good point. I think your proposed solution is good; just bork out if the hosts/ports don't match.