Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

commons-httclient: Request URI in protokol header

Thread view: 
markusw2006@gmx.de - 11 May 2006 06:21 GMT
Hello,

I have a problem with the commons-httpclient package (jakarta). Suppose
I want to send a POST request (PostMethod in commons-httpclient) to the
URL http://my-server:9999/Test. The commons-httpclient generates a
request looking like this:

POST /Test HTTP/1.1
User Agent: Jakarta Commons-HttpClient/3.0-rc2
HOST: my-server:9999
...

This is a valid request. But in our intranet the request is blocked by
a firewall, because of the relative path in the request line (first
line). The firewall needs a request like this:

POST http://my-server:9999/Test HTTP/1.1
User Agent: Jakarta Commons-HttpClient/3.0-rc2
HOST: my-server:9999
...

This format is mandatory (RFC 2616) if the request is send via a proxy.
I've examined the commons-httpclient code and found out that the
complete URL is written in the request line if I set a proxy in the
HttpClient class (in the HostConfiguration). But I don't know the URL
of the proxy where the firewall runs. Is there another way to force the
commons-httpclient to write the full URL?

I've tried to set the destination server as proxy, too (in the example
above I've set my-server:9999 as proxy). This worked in a local
environment. I haven't tested if this will work in our intranet (since
the test will take some time) and it also looks a little bit like a
dirty workaround to me.

Regards
Markus
Chris Uppal - 11 May 2006 10:54 GMT
> This format is mandatory (RFC 2616) if the request is send via a proxy.
> I've examined the commons-httpclient code and found out that the
> complete URL is written in the request line if I set a proxy in the
> HttpClient class (in the HostConfiguration). But I don't know the URL
> of the proxy where the firewall runs.

To me, that sounds as if your firewall is configured to reject all connections
which bypass the nominated proxy (not necessarily the firewall itself).  If so
then you don't have a code workaround -- it's a network configuration issue,
and you have to find out which server the Mighty Network Administrator has
configured.

I.e. talk to your network people.

(Of course, it may be a configuration error in the firewall, but you would be
well-advised not to advance this suggestion to the Mighty Network
Administrator)

   -- chris


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.