function resolveBinding(hostConfig, defaultPort) {
  const parsed = url.parse(hostConfig, false, true);
  let family = "ipv4";

  let host = parsed.hostname;

  if (!/^\[.+\]/.test(parsed.host)) {
    const tmp = host.split(":");

    if (tmp[1]) {
      family = tmp[1];
    }
  }

  return {
    ipv6: family === "ipv6",
    port: parsed.port || defaultPort,
  };
}
@param {String} hostConfig The host representation as string, i.e. tcp://[eth0:ipv6]:9876
@param {integer} defaultPort Default port to use if none found from the config
@returns {Object}