File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Java Url with proxy conf. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java Url with proxy conf." Watch "Java Url with proxy conf." New topic

Java Url with proxy conf.

Tom Ngo

Joined: Jun 08, 2005
Posts: 1
I am running java 1.4.2 and am using URL api to connect to an http address to download xml files. I am trying to incorporate proxy server configuration into this, does anyone here know how to add a proxy server via URL address or through the System property of a java vm?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63838


There aren't may rules that have been put into place here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
Lewin Chan
Ranch Hand

Joined: Oct 10, 2001
Posts: 214
There's plenty of articles about this on the web, but if you're using HttpUrlConnection then you can just set the system properties

-DproxySet=true -DproxyHost= -DproxyPort=8080

To enable proxy server handling.

If you need authorization for the proxy server (a-la RFC2617 Basic style, then you'll need to manage that yourself along the lines of

I have no java certifications. This makes me a bad programmer. Ignore my post.
I agree. Here's the link:
subject: Java Url with proxy conf.
It's not a secret anymore!