Solved

About Proxy Server

Posted on 1998-07-02
1
155 Views
Last Modified: 2010-03-30
If i want to download any page for a given URL i'll have to
download the page from the Proxy Server. How can i connect my program with the proxy server to download the required page through my program?
0
Comment
Question by:pappu070298
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
fontaine earned 100 total points
ID: 1224429
You have two options.

1) At the starting of the program, use a command line similar to the following:

java -DproxySet=true -DproxyHost=proxy.com -DproxyPort=80 MyJavaProg

2) In your Java prog. add the following:

import java.util.properties;
// bla bla bla

Properties props = System.getProperties(); // get the system properties
props .put("proxySet", true); // inform the VM to use a proxy
props .put("proxyHost", "proxy.com"); // specify the proxy server to use
props .put("proxyPort", "80"); // specify the port the proxy server is listening on
System.setProperties(props); // set the (modified) system properties

The rest does not change in your program. Example: if you want to get the home page of
EE, you will use the "http://www.experts-exchange.com" URL in the app. Because you
have configured the app. the use of a proxy,  the EE homepage will automatically
be loaded through the proxy.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question