Java and proxies

Discussion in 'Java' started by Paul Taylor, Jun 28, 2005.

  1. Paul Taylor

    Paul Taylor Guest

    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.

    --
    Remove _rem_ before replying by email.
     
    Paul Taylor, Jun 28, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roger
    Replies:
    3
    Views:
    990
    Daniel Hagen
    Jul 13, 2004
  2. Chris Smith

    Java HTTP proxies fail open?

    Chris Smith, Jul 18, 2005, in forum: Java
    Replies:
    1
    Views:
    495
    Acidus
    Jul 18, 2005
  3. Lothar Scholz

    httplib and proxies

    Lothar Scholz, Jun 3, 2004, in forum: Python
    Replies:
    2
    Views:
    347
    Colin Brown
    Jun 4, 2004
  4. Fuzzyman

    urllib2, https, and proxies

    Fuzzyman, Jun 29, 2005, in forum: Python
    Replies:
    0
    Views:
    407
    Fuzzyman
    Jun 29, 2005
  5. Alan Kennedy
    Replies:
    0
    Views:
    355
    Alan Kennedy
    Jul 2, 2009
Loading...

Share This Page