• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Url with proxy conf.

 
Tom Ngo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Lewin Chan
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic