MB-35926: Handle port mapping when hostname is missing ...
MB-35926: Handle port mapping when hostname is missing ...

... from the nodeServices endpoint.

When the hostname is missing from the nodeServices endpoint, it means
that the Couchbase Server node has been configured on the loopback
address (127.0.0.1 or [::1]). This further means that the whole cluster
must be configurd on the loopback (as nodes on other hosts wouldn't be
able to communicate with a loopback-configured node since they wouldn't
have its address.)

So, if a client can reach a server port via a certain hostname and the
node is configured on the loopback, it's safe to assume that the client
is accessing the nodes via that hostname and it's sufficient to compare
ports to map.

Change-Id: I4226eebd82ed1bf51a270a5e12d114cb9e366178
Reviewed-on: http://review.couchbase.org/114713
Tested-by: Dave Finlay <7b10a9ed9f70e64c30b07607a671ae61c33f14c8@couchbase.com>
Reviewed-by: Sitaram Vemulapalli <8d86a491dcdf321bac78bef141a8229a59bf9211@couchbase.com>

couchbase/go-couchbase