Forum Stats

  • 3,828,051 Users
  • 2,260,849 Discussions
  • 7,897,439 Comments

Discussions

Applet and Browser Proxy

831360
831360 Member Posts: 1
edited Jan 14, 2011 3:56PM in Java Programming
I have an applet that opens connections to my HTTP server to download files.

When I have a proxy on the network, and I seto this proxy in the browser's time to make the connection, it returns an error "java.io.IOException: Server returned HTTP response code: 411 for URL"

If I add an ip from my server as exception to the proxy in the browser or java plugin works fine, without error.

I can not move from machine to machine by adding an exception for the server ip.

I wanted to make my applet automatically added the exception, through parameters.

Tei use the system properties,

/ / System.setProperty ("http.proxyHost" ipHostProxy);
/ / System.setProperty ("http.proxyPort", String.valueOf (proxyPort));
/ / System.setProperty ("http.nonProxyHosts" ipHost);
/ / System.setProperty ("http.proxySet", "true ");

but had no effect.
Tagged:

Answers

  • DrClap
    DrClap Member Posts: 25,479
    If you use Apache's HttpClient package, you'll find it doesn't use any of the built-in networking classes in Java (such as URLConnection). Instead it implements HTTP from scratch. You'll find it allows you much more flexibility in defining proxy connections.
This discussion has been closed.