Solved

About Proxy Server

Posted on 1998-07-02
1
148 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
1 Comment
 
LVL 5

Accepted Solution

by:
fontaine earned 100 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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 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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now