Forums Register Login

Java Url with proxy conf.

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
"tcn2k",

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.

Thanks!
bear
Forum Bartender
+Pie Number of slices to send: Send
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=192.168.0.1 -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

What? What, what, what? What what tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1410 times.
Similar Threads
URL reading problem
Working with Internet URL through Proxy from Java Code
Working with Internet URL from Eclipse
SSL
URL reading problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 21:40:46.