Don't do that, you can return the host and port in one request and match on them directly, for example host\nport. Also don't use default, just put the actual number, it'll save you some complexity further on.