public InetSocketAddress getConnectorAddress(int index) {
    Preconditions.checkArgument(index >= 0);

    if (index > webServer.getConnectors().length) {
      return null;
    }

    ServerConnector c = (ServerConnector) webServer.getConnectors()[index];
    if (c.getLocalPort() == -1 || c.getLocalPort() == -2) {
      // -1 if the connector has not been opened
      // -2 if it has been closed
      return null;
    }

    return new InetSocketAddress(c.getHost(), c.getLocalPort());
  }
Get the address that corresponds to a particular connector.
@return the corresponding address for the connector, or null if there's no such connector or
        the connector is not bounded.
hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java