Description
currently it use
HttpHost proxy = new HttpHost(isa.getHostName(), isa.getPort());
and InetSocketAddress.getHostName will trigger dns reserve resolution when the proxy address is literal ip
/** * Gets the {@code hostname}. * Note: This method may trigger a name service reverse lookup if the * address was created with a literal IP address. * * @return the hostname part of the address. */
This dns reserve resolution is time-consuming and should be avoid, as the proxy is specified by users, they can specify as hostname or literal ip per their requirement.
We should use InetSocketAddress.getHostString instead, this will return what users has specified as is
/** * Returns the hostname, or the String form of the address if it * doesn't have a hostname (it was created using a literal). * This has the benefit of <b>not</b> attempting a reverse lookup. * * @return the hostname, or String representation of the address. * @since 1.7 */