You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Chandra Mouleeswaran <ch...@tumbleweed.com> on 2006/02/21 20:09:05 UTC

httpclient 3.0 - SOCKS Proxy Support

Hi,

My understanding looking at the httpclient 3.0 features was that SOCKS 
proxy support was integral part of the code.
However, I don't see any API which can take a Proxy object as argument 
and create a socket using jdk 1.5's
SOCKS support.

Kindly clarify how SOCKS is supported in 3.0

Thanks a lot.

- Chandra


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


Re: httpclient 3.0 - SOCKS Proxy Support

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2006-02-22 at 14:04 -0800, Chandra Mouleeswaran wrote:
> Oleg,
> 
> I also looked into adding a custom socket factory. The issue was, Java 
> exposes very little in terms of the needed API and be able to use their
> underlying PlainSocketImpl and SOCKS. It's not possible to just provide 
> a simple SOCKS api and have all the regular SOCKET calls be
> delegated to their Plain Socket.
> 
> Do you have any pointers to sample code of folks who have implemented 
> custom socketfactory?
> 

Chandra,

There is quite a few samples in the HttpClient contrib package. They are
all mainly SSL related, though:

http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/

This one is probably closer to what you are trying to do:

http://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/util/SlowSocket.java
http://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHttpClientSocketFactory.java

Please in the future do respond to the mailing list, not to me directly

Cheers,

Oleg

> Thanks a lot.
> 
> - Chandra
> 
> Oleg Kalnichevski wrote:
> 
> >On Tue, 2006-02-21 at 11:09 -0800, Chandra Mouleeswaran wrote:
> >  
> >
> >>Hi,
> >>
> >>My understanding looking at the httpclient 3.0 features was that SOCKS 
> >>proxy support was integral part of the code.
> >>However, I don't see any API which can take a Proxy object as argument 
> >>and create a socket using jdk 1.5's
> >>SOCKS support.
> >>
> >>Kindly clarify how SOCKS is supported in 3.0
> >>
> >>    
> >>
> >
> >HttpClient does not support SOCKS proxying directly. However, it can
> >make use of whatever support the JRE provides. if the underlying JRE is
> >capable of opening sockets via a SOCKS server, so is HttpClient.  
> >
> >One can also consider implementing a custom socket factory that makes
> >use of jdk 1.5 functionality and registering it as a default protocol
> >socket factory for the desired protocol scheme.
> >
> >Hope that clarifies things a little
> >
> >Oleg
> >
> >  
> >
> >>Thanks a lot.
> >>
> >>- Chandra
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> >>
> >>
> >>    
> >>
> >
> >
> >
> >  
> >
> 
> 
> "Tumbleweed E-mail Firewall <tumbleweed.com>" made the following
>  annotations on 02/22/06, 14:11:55
> ------------------------------------------------------------------------------
> This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed.  If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.
> 
> ==============================================================================
> 
> 


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


Re: httpclient 3.0 - SOCKS Proxy Support

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2006-02-21 at 11:09 -0800, Chandra Mouleeswaran wrote:
> Hi,
> 
> My understanding looking at the httpclient 3.0 features was that SOCKS 
> proxy support was integral part of the code.
> However, I don't see any API which can take a Proxy object as argument 
> and create a socket using jdk 1.5's
> SOCKS support.
> 
> Kindly clarify how SOCKS is supported in 3.0
> 

HttpClient does not support SOCKS proxying directly. However, it can
make use of whatever support the JRE provides. if the underlying JRE is
capable of opening sockets via a SOCKS server, so is HttpClient.  

One can also consider implementing a custom socket factory that makes
use of jdk 1.5 functionality and registering it as a default protocol
socket factory for the desired protocol scheme.

Hope that clarifies things a little

Oleg

> Thanks a lot.
> 
> - Chandra
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 


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