Solved

About Proxy Server

Posted on 1998-07-02
1
151 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle 11g 23 106
null output 3 35
Facing this issue for maven proxy setting 2 19
pagenation logic how it is working in my code 1 52
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

792 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