Alternatively you can inspire from the code available in 4.2: http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/DnsResolver.java
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SystemDefaultDnsResolver.java http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java On 14 October 2011 20:43, Vasile Alin <[email protected]> wrote: > On 14 October 2011 18:58, Matt Solnit <[email protected]> wrote: >> Hi everyone. In HC 4.0, the way that a host name is converted to an >> InetAddress object could be overridden by passing a custom HostNameResolver >> implementation to the socket factory. It looks like in HC 4.1, this is >> deprecated. What is the preferred way of customizing host name resolution? >> >> I took a look at the source code, and I am guessing I will need to override >> DefaultClientConnectionOperator.resolveHostName(). But I want to be sure >> this is the best way. > > For HC 4.1 I would say the same, this looks the only way to do it. > Will be hard to use your implementation because you must extend also > SingleClientConnManager in order to inject it. > > In HC 4.2 this will be much simpler, but this version is not GA yet. > >> >> -- Matt >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
