Issue Details (XML | Word | Printable)

Key: HTTPCLIENT-136
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Richard Perrott
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
HttpComponents HttpClient

Inadequate HTTP proxy server support in HttpClient.

Created: 19/Dec/02 11:10 PM   Updated: 20/Jul/07 06:36 PM
Return to search
Component/s: HttpClient
Affects Version/s: Snapshot
Fix Version/s: 4.0 Alpha 1

Time Tracking:
Not Specified

Environment:
Operating System: All
Platform: PC
Issue Links:
Incorporates
 

Bugzilla Id: 15534
Resolution Date: 13/May/07 08:08 PM


 Description  « Hide
1. The HttpClient class does not save the StatusLine from the hidden
ConnectMethod object used to connect via an HTTP proxy server, thus any proxy
failures are only picked up as 'anonymous exceptions', this is useless for
gracefull recovery and rapid debugging.

2. The current class structure is too fragile to neatly support HTTP Proxy (and
authenication) chains so it would be a good idea to look at this at the same
time, preferable with support for a Proxy chain redirect when an non/dead HTTP
Proxy server is found.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Oleg Kalnichevski added a comment - 29/Apr/03 07:58 PM
The problem has been worked around by means of a very ugly hack. A better
solution does not appear possible without a significant redesign. Possible
solution would be to split monolithic HttpMethod interface into a pair of
HttpRequest/HttpResponse interfaces, which would allow executing extra requests
(such as CONNECT request or GET request in response to POST request redirect)
behind the scene and returning the resultant response to the caller.

Oleg

RJ Auburn added a comment - 15/May/04 04:08 AM
What are the details on this "ugly hack"?

Oleg Kalnichevski added a comment - 16/May/04 05:29 PM
In HttpClient 2.0 API HttpMethod interface represents both request and response,
which effectively implies one to one relationship between a request and a
response. Unfortunately this is not always true. For instance, HTTP proxy
tunneling requires a CONNECT method to be executed against the server before the
original HTTP method can be executed against the target server. Should the
CONNECT method fail (due to authorization error, for instance), its response
should be returned as if it was a response to the original HTTP method. This is
currently not possible due to the monolithic design of HttpMethod interface. The
problem has been worked around by providing a method to copy the response
content (status line, response headers and response body) from one method onto
another. A better, more elegant solution requires HttpMethod interface be split
into HttpREquest / HttpResponse pair of interfaces

Kees Jongenburger added a comment - 20/Sep/04 09:40 PM
the proxy method does not work either when creating a
new HttpClient(new MultiThreadedHttpConnectionManager());
*tried 2.0 and 3.0-alpha2*

Oleg Kalnichevski added a comment - 20/Sep/04 09:48 PM
Kees, what exactly do you mean by a "proxy method"? Please consider providing
sample code and the wire/debug trace

http://jakarta.apache.org/commons/httpclient/troubleshooting.html

Oleg

Oleg Kalnichevski added a comment - 13/May/07 08:08 PM
This long standing bug has finally been fixed in SVN trunk.

Also see HTTPCLIENT-649

Oleg