You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Murty Akundi (JIRA)" <ji...@apache.org> on 2007/04/24 16:02:15 UTC

[jira] Created: (HTTPCLIENT-649) Support multiple proxies

Support multiple proxies
------------------------

                 Key: HTTPCLIENT-649
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
             Project: HttpComponents HttpClient
          Issue Type: New Feature
          Components: HttpClient
    Affects Versions: 3.1 RC1, 3.0.1
         Environment: win/linux/unix
            Reporter: Murty Akundi


HttpClient supports one proxy currently.
Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (HTTPCLIENT-649) Support multiple proxies

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roland Weber resolved HTTPCLIENT-649.
-------------------------------------

    Resolution: Fixed

I've added proxy chain support to HttpConn::ManagedClientConnection and a plugin point to HttpClient, see DefaultClientRequestDirector.createTunnelToProxy(...).

Due to the complexity of proxy authentication, we cannot provide full support for proxy chains in HttpClient at this time. I just don't have the cycles available to refactor the proxy authentication logic. Everybody is invited to submit patches towards that goal.

cheers,
  Roland


> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpConn
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>            Assignee: Roland Weber
>             Fix For: 4.0 Alpha 2
>
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Re: [jira] Updated: (HTTPCLIENT-649) Support multiple proxies

Posted by Roland Weber <os...@dubioso.net>.
Hi Oleg,

> Oleg Kalnichevski updated HTTPCLIENT-649:
> ---
> Roland, We do not necessarily have to provide this feature in the stock
> version of HttpClient if this will increase the complexity of connection
> management code dramatically. As long as the users are able to plug in
> their own custom connection operator this should be sufficient.

That's the problem. I made HttpRoute a class rather than an interface,
and it's not a class meant to be extended. Connection managers rely on
HttpRoute to determine re-usability. CONNECT requests are generated by
the director, operators are not supposed to handle it under the covers.
Especially not if proxy authentication comes into play. The route
building logic used by the (default) director is also tied to the
limitations of HttpRoute. This will need some pondering. The quickest
hack might be "ProxyChain extends HttpHost" for specifying proxies
and a custom director to interpret that.

cheers,
  Roland

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


[jira] Updated: (HTTPCLIENT-649) Support multiple proxies

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCLIENT-649:
-----------------------------------------

    Fix Version/s:     (was: 4.0 Alpha 1)
                   4.0 Alpha 2

Roland,
We do not necessarily have to provide this feature in the stock version of HttpClient if this will increase the complexity of connection management code dramatically. As long as the users are able to plug in their own custom connection operator this should be sufficient.

Oleg


> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpConn
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>             Fix For: 4.0 Alpha 2
>
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-649) Support multiple proxies

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514322 ] 

Roland Weber commented on HTTPCLIENT-649:
-----------------------------------------

The pieces are in place: HttpRoute represents proxy chains, ThreadSafeClientConnManager uses HttpRoute.
The last step is to add the missing ManagedClientConnection.tunnelProxy(...).


> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpConn
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>             Fix For: 4.0 Alpha 2
>
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Assigned: (HTTPCLIENT-649) Support multiple proxies

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roland Weber reassigned HTTPCLIENT-649:
---------------------------------------

    Assignee: Roland Weber

> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpConn
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>            Assignee: Roland Weber
>             Fix For: 4.0 Alpha 2
>
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (HTTPCLIENT-649) Support multiple proxies

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCLIENT-649:
-----------------------------------------

      Component/s:     (was: HttpClient)
                   HttpConn
    Fix Version/s: 4.0 Alpha 1

Murty, 

I think this kind of functionality is usually referred to as proxy chaining. Presently HttpClient does not support it and see no easy and elegant way of adding it to the HttpClient 3.x code line. HttpClient is currently undergoing a complete redesign and we certainly could add support for proxy chaining to HttpClient 4.0. 

Oleg

> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpConn
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>             Fix For: 4.0 Alpha 1
>
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-649) Support multiple proxies

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491339 ] 

Oleg Kalnichevski commented on HTTPCLIENT-649:
----------------------------------------------

Murty,

I am not sure I understand what exactly you want to say by "we may need to connect more than one proxies before connects to target resource". Please clarify.

Oleg

> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpClient
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-649) Support multiple proxies

Posted by "Murty Akundi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491385 ] 

Murty Akundi commented on HTTPCLIENT-649:
-----------------------------------------

Oleg
Thank you for response. 
I am using HttpClient code to access http(s) resources. For example  http(s)://www.verisign.com.
My code is deployed under an application server which is located below three firewalls and that needs to connect through 3 proxies to reach the final target.
For example I have following 3 proxies and target
proxy1:9999
proxy2:7777
proxy3:5555
http(s)://www.verisign.com
First I need to open a socket and connect to proxy1:9999 and then connect proxy2:7777 and then connect to proxy3:5555 to reach the target resource.
Currently HttpClient supports one proxy and i need to goes through more than one proxies. So i had to modify HttpMethodDirector class to tunnel the socket through the proxies.
regards



> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpClient
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-649) Support multiple proxies

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492464 ] 

Roland Weber commented on HTTPCLIENT-649:
-----------------------------------------

And here I thought this was a far-out use case we would not have to consider. HttpRoute is designed for a single proxy.
Re-thinking the approach will take time. I believe that alpha1 is a rather optimistic target for this requirement.

cheers,
  Roland



> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpConn
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>             Fix For: 4.0 Alpha 1
>
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-649) Support multiple proxies

Posted by "Murty Akundi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492481 ] 

Murty Akundi commented on HTTPCLIENT-649:
-----------------------------------------

Ronald
    Thanks for reply. I think this use case is real use case. Most of the comanies and people are using java on middle tier that locates behind firewalls.  
We can plugging through more than one proxies but that is really not secured.  
Other solution is to write custom protocol handler to support multiple proxiesc but  HttpClient does not support it since it does not use URLStreamHandler internally.
I think there is no other solution with HttpClient to support multiple proxies at this time.
I have customized HttpClient and HttpMethodDirector classes to tunnel through configured number of proxies and working fine.
Please consider it for next major release.
regards
Murty


> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpConn
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>             Fix For: 4.0 Alpha 1
>
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-649) Support multiple proxies

Posted by "Ortwin Glück (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522942 ] 

Ortwin Glück commented on HTTPCLIENT-649:
-----------------------------------------

The feature has been requested in the past:

http://issues.apache.org/jira/browse/HTTPCLIENT-136
http://issues.apache.org/jira/browse/HTTPCLIENT-35

especially for 4.0 here:

http://marc.info/?l=httpclient-commons-dev&m=110552030923369&w=2

but somehow the discussion ended up revolving around cookie storage.

> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpConn
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>            Assignee: Roland Weber
>             Fix For: 4.0 Alpha 2
>
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (HTTPCLIENT-649) Support multiple proxies

Posted by "Murty Akundi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522933 ] 

Murty Akundi commented on HTTPCLIENT-649:
-----------------------------------------

Thank you very much for all you for adding new feature.

> Support multiple proxies
> ------------------------
>
>                 Key: HTTPCLIENT-649
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-649
>             Project: HttpComponents HttpClient
>          Issue Type: New Feature
>          Components: HttpConn
>    Affects Versions: 3.0.1, 3.1 RC1
>         Environment: win/linux/unix
>            Reporter: Murty Akundi
>            Assignee: Roland Weber
>             Fix For: 4.0 Alpha 2
>
>
> HttpClient supports one proxy currently.
> Our requirement is to suppport more than one proxy. We may need to connect more than one proxies before connects to target resource. 
> I found that HttpMethodDirector creates tunnelled socket and there is no easy way to plugin our custom HttpMethodDirector class with HttpClient other than extending HttpClient to override "public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state" method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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