Java and proxies

P

Paul Taylor

Hi,

I have written an application and I would like it to work on networks
protected with a proxy server. I am using the following lines of code to
set the proxy server:

System.setProperty("http.proxyHost", "192.168.1.61");
System.setProperty("http.proxyPort", "7867");

At the moment, the 192.168.1.61 host doesn't exist on my network, so I
expect my application to time out.

Without the above two lines of code, web access is less than a second. My
app is getting data directly. But with the above two lines of code web
access occurs in about 4 seconds. It looks like my app looks for the
proxy (for about 3 seconds), doesn't find it, so goes directly.

Is this how java handles proxy servers, going directly if no proxy
is found, or am I doing something wrong?

Thanks,

Paul.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top