Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6BE2A10430 for ; Fri, 3 May 2013 18:42:20 +0000 (UTC) Received: (qmail 6797 invoked by uid 500); 3 May 2013 18:42:20 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 6761 invoked by uid 500); 3 May 2013 18:42:20 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 6749 invoked by uid 99); 3 May 2013 18:42:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 May 2013 18:42:19 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ryan.justin.smith@gmail.com designates 209.85.219.47 as permitted sender) Received: from [209.85.219.47] (HELO mail-oa0-f47.google.com) (209.85.219.47) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 May 2013 18:42:12 +0000 Received: by mail-oa0-f47.google.com with SMTP id m1so1987605oag.34 for ; Fri, 03 May 2013 11:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=AgBiK/0I6EBsAtlV3ql/4VI2OYQaSAAYaLtpXRiWwp4=; b=iWV8QvMJoMd1mnopsq299gnooP7vD4uhXoUb/egUzID37aRwIQVlNSN+cu5OltyQ9k VWZc/UaPzX7RnKpa7t2/tMAEPxZ80E9897TXC3bVicRY4ft3Vo7tZdmLigOi5xd6VE5U izqbikO9wz1FuKFPkVeJwtP8/d+Vk5sGwrFMSit6g3h1mO91gPBICFg2TpvLFmEhNgfs cF2tvNITJ2ws+9uGxUGFRo6DWM85NvePhQ+4zICKWE2ybDNYReHBBV8gfQNbJNgyCMi8 qyPFFRWDXa+DxCHqY4eOxkQDYW4TMmxg2Z8ljksFTgBCtNsEvKNjrVKtx1mx61ExcWkD KCqQ== MIME-Version: 1.0 X-Received: by 10.60.131.6 with SMTP id oi6mr2910255oeb.19.1367606511492; Fri, 03 May 2013 11:41:51 -0700 (PDT) Received: by 10.182.241.132 with HTTP; Fri, 3 May 2013 11:41:51 -0700 (PDT) In-Reply-To: <1367600754.11532.11.camel@ubuntu> References: <1367521602.7214.8.camel@ubuntu> <1367597760.11532.7.camel@ubuntu> <1367600754.11532.11.camel@ubuntu> Date: Fri, 3 May 2013 14:41:51 -0400 Message-ID: Subject: Re: Proxy chaining From: R Smith To: HttpClient User Discussion Content-Type: multipart/alternative; boundary=089e013cb81a4f64f304dbd4b495 X-Virus-Checked: Checked by ClamAV on apache.org --089e013cb81a4f64f304dbd4b495 Content-Type: text/plain; charset=ISO-8859-1 Thanks as always Oleg! On Fri, May 3, 2013 at 1:05 PM, Oleg Kalnichevski wrote: > On Fri, 2013-05-03 at 12:45 -0400, R Smith wrote: > > Thanks Oleg. Great help. Ive been using the logic from > > createTunnelToTarget() initially but wasnt sure if I needed a "CONNECT" > > method. Now I see thats what the tunnelToTarget is doing, making a > > connect. Thanks for pointing me back. > > > > A question about auth support for proxies, would it make more sense to > fork > > 4.3.x instead of 4.2.x if I wanted to attempt auth support for proxy > chains? > > > > Yes, absolutely. The most fundamental change that would have to make to > achieve that is to support multiple proxy AuthStates, one per proxy hop. > > Oleg > > > > Thanks again for all the help. > > -Ryan > > > > On Fri, May 3, 2013 at 12:16 PM, Oleg Kalnichevski > wrote: > > > > > > > > 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 > > > 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: 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 > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org > For additional commands, e-mail: httpclient-users-help@hc.apache.org > > --089e013cb81a4f64f304dbd4b495--