Information for Technology

Main menu

Post navigation

Java HTTP Proxy Settings

Overview

For local networks within an organization, access to the public-domain Internet is often via a HTTP Proxy. This article talks about the HTTP proxy settings for the Java environment. I did not find a good document on the Web to describe these settings; Had to discover many of them by trial-and-error. Hence this article.

Your HTTP call needs to tunnel through the HTTP proxy (using SOCKS authentication). Even if authentication is not required, you would still need to configure the URL and the Port of your HTTP proxy.

Settings

Use one of the methods below for your JVM proxy settings. Try an alternate method if any particular method does not work. In most cases, you should not require any change the pre-compiled Java code for proxy settings. JVM’s environment settings should be enough to fix this problem.

Setting System Properties in Code

Add the following lines in your Java code so that JVM uses the proxy to make HTTP calls. This would, of course, require you to recompile your Java source. (The other methods do not require any recompilation.):

Hi
I am also getting same problem ,any one kindly help to solve the below issue
java.io.IOException: Server returned HTTP response code: 407 for URL: http://wwwd.way2sms.com/auth.cl
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1236)
at com.aswinanand.sms.SMS.send(SMS.java:76)
at MeraSMS.main(MeraSMS.java:31)

Hiya very nice site!! Guy .. Excellent .. Amazing .. I’ll bookmark your site and take the feeds additionally?I’m glad to search out numerous useful information right here within the post, we’d like work out more techniques in this regard, thanks for sharing. . . . . .

Excellent post. I was checking continuously this blog and I am impressed!
Very helpful info particularly the last part :
) I care for such info a lot. I was seeking this particular information for a long time.
Thank you and good luck.