code: public static String socketAddressToUrlString(InetSocketAddress address) {
  		if (address.isUnresolved()) {
  			throw new IllegalArgumentException("Address cannot be resolved: " + address.getHostString());
  		}
  		return ipAddressAndPortToUrlString(address.getAddress(), address.getPort());
  	}
docs: Encodes an IP address and port to be included in URL. in particular, this method makes
  sure that IPv6 addresses have the proper formatting to be included in URLs.
  
  @param address The socket address with the IP address and port.
  @return The proper URL string encoded IP address and port.