On Sun, Aug 23, 2009 at 11:57:56PM +0200, Peter Paul wrote:
> Hello,
> I'm about add SOCKS proxy support to an application that uses
> HttpClient and it's HttpProxy capabilities. While Http Proxy support is
> given by the HttpClient API, I could not find said thing for SOCKS, so
> I found that it would be nessesary to implement it via
> ProtocolSocketFactory.
> However, the application in question can has several open connections
> that even may go through different proxies. There is a HttpClient
> object for every connection. So I did a ProxySocketFactory class and
> specified a custom proxy protocol
> 
> Protocol myProxy = new Protocol("http", new ProxySocketFactory(proxy),
> 80);
> 
> How can I get the HttpClient object to use this protocol by default?
> There is a default protocol in HttpClient's HostConfiguration object,
> but it only provides a getProtocol method.
> 

Use static Protocol#register method


> So maybe there is a better way on how to get an application support
> SOCKS as well? I have not figured out yet how to get authentification
> either.
> 

As far as I know SOCK proxying works on the java.net.Socket level and therefore
should be absolutely transparent for the HTTP layer.

Oleg

> I'm looking foreward hearing from you
> Peter
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to