On Thu, 2013-05-02 at 15:58 -0400, R Smith wrote: > Thanks Oleg. Thanks for the pointer on CONNECT. Makes sense. Ive forked > the httpclient 4.2.x branch locally so I have my own copy to work with. I > dont mind submitting patches if I have something usable and generic enough > when Im done. > > So am I correct in thinking I should still use a "CONNECT" method for > chaining but I should make HttpConnect() a private inner class of my > custom RequestDirector class so end users wont call it? Does HttpClient > use the "CONNECT" method anywhere internally that I am missing so I can see > it being used as an example? > > Just trying to figure out if Im barking up the right tree with the CONNECT > method for proxy chaining. I can proxy chain using command line telnet, so > I am just trying to recreate the same calls in httpclient at this point. > > Thanks again for all the help, > -Ryan > >
Ryan I think you are not the right track. Have a look at the #createTunnelToTarget. It basically contains all the necessary machinery to establish a simple (one proxy hop) route. You will need to do something very similar once per proxy hop. Things will get _very_ difficult though if you decide to support different authentication contexts per individual proxy hops. This will likely to require a major refactoring of authentication state management in HttpClient. Oleg > > On Thu, May 2, 2013 at 3:06 PM, Oleg Kalnichevski <[email protected]> wrote: > > > On Wed, 2013-05-01 at 09:58 -0400, R Smith wrote: > > > Hello, > > > > > > I have a question on proxy chaining. > > > > > > I know that httpclient supports a single hop proxy, (Source -> P1 -> > > > Target) out of the box by using TUNNEL_TARGET. However, when I provide > > an > > > extra proxy in the chain using a custom > > HttpRoutePlanner#determineRoute(), > > > (Source -> P0 -> P1 -> Target) I use TUNNEL_PROXY and need to implement > > a > > > custom DefaultRequestDirector#createTunnelToProxy(). Im just not sure > > what > > > all should be done in this method. My route object looks correct, I can > > > see both proxies and target but Im just not sure if I need to make a > > > connection to the 1st proxy using a custom HttpConnect method object. I > > > noticed there is no Http "CONNECT" method, there is HttpGet, HttpPost and > > > HttpDelete. Should I create my own HttpConnect object for proxy chaining > > > or can I accomplish the "Connect" command on the 1st proxy in the chain > > > some other way? > > > > > > Any example code or advice would be appreicated, thank you. > > > -Ryan > > > > Ryan, > > > > HttpClient routing API is fully proxy chaining aware. However, request > > execution code presently only supports connection tunneling through a > > single proxy only. Protocol logic for proxy chaining still needs to be > > implemented. > > > > There is no class representing CONNECT method in HttpClient because it > > is a special purpose method and as such it should never be executed by > > the end users of HttpClient. > > > > Hope this makes some sense. > > > > Oleg > > > > > > --------------------------------------------------------------------- > > 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]
