hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Moss <amm...@learningsoft.net>
Subject Re: Problem with httpclient 3-x and socks server
Date Mon, 03 Mar 2008 16:23:46 GMT
You need to create your own custom ProtocolSocketFactory[1] and 
implement the createSocket methods in the manner you mentioned. Once you 
do that, you need to tell HttpClient to use it. Something like this:

     if (shouldUseSocks) {
         Protocol.registerProtocol("http",
             new Protocol("http", new MyProtocolScoketFactory(), 80));
     }

[1] 
http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/protocol/ProtocolSocketFactory.html

Good luck.

-Alan

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message