hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Seb <meleag...@hotmail.com>
Subject RE: Problem with httpclient 3-x and socks server
Date Tue, 04 Mar 2008 12:49:24 GMT

Thanks a lot, it solved my issue !I've already tried to create a new ProtocolSocketFactory,
but I did not knew anything about Protocol.registerProtocol() method :(Thanks,Seb> Date:
Mon, 3 Mar 2008 17:38:51 +0100> From: ossfwot@dubioso.net> To: httpclient-users@hc.apache.org>
Subject: Re: Problem with httpclient 3-x and socks server> > Hi Sebastien, Alan,>
> Alan Moss wrote:> > 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));> >     }> >
That's the idea, although I would move the if(...) part into the> socket factory. Things
get ugly if you want to juggle between> different socket factories for the same protocol/scheme.>
> Alternatively, if you're on Java 5 or later, you might want to> install your own ProxySelector
in the "legacy" java.net API :-)> > http://java.sun.com/j2se/1.5.0/docs/api/java/net/ProxySelector.html#setDefault(java.net.ProxySelector)>
http://java.sun.com/j2se/1.5.0/docs/guide/net/proxies.html> > > cheers,>    Roland>
> > > > [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> > > > > --------------------------------------------------------------------->
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org> For additional commands,
e-mail: httpclient-users-help@hc.apache.org> 
_________________________________________________________________
Microsoft vous recommande de mettre à jour Internet Explorer.
http://specials.fr.msn.com/IE7P25
---------------------------------------------------------------------
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