Solved

About Proxy Server

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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
maven module vs maven project 3 116
java imports not found 4 71
Bot application - advice 3 81
Print Rhino Java Array in Javascript 1 58
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

751 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