On Sat, 2011-07-02 at 17:35 +0000, Steve Labarbera wrote:
> I was using HTTPOClient for a while to handle all my HTTP request /responses. 
> However, I have recently needed to build my own client due to my need to send 
> requests that did not correctly URLEncode specified by RFC Standards. I'm 
> creating a proxy and need to be able to handle when the client "The browser" 
> sends a CONNECT request. I was hoping to be able to look at how HHTPClient 
> does it to maybe help me figure it out. Does anyone know where exactly that 
> section of code lives? I looked 
> httpclient\src\main\resources\java\org\apache\http\conn\ssl but could not see 
> anything?
> 
> I'm having a very very hard time trying to handle this CONNECT request and 
> have looked all over the internet. This i'm hoping will be able to enlighten 
> me as to how its handled.
> 
> Regards,
> 
> Steve

Hi Steve

Take a look at the DefaultRequestDirector [1] and #createTunnelToTarget
method in particular for a blocking (synchronous) implementation and at
the DefaultAsyncRequestDirector [2] for a non-blocking (asynchronous)
one.

Hope this helps

Oleg

PS: by the way, building an HTTP client from scratch is not an easy
task. You might be better off reusing HttpCore (or a similar HTTP
transport toolkit) for low level stuff. 

[1]
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
[2]
http://svn.apache.org/repos/asf/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultAsyncRequestDirector.java



> ---------------------------------------------------------------------
> 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