proxy

Discussion in 'Java' started by IveCal, May 6, 2006.

  1. IveCal

    IveCal Guest

    Properties systemSettings = System.getProperties();
    systemSettings.put("http.proxyHost","192.168.0.254") ;
    systemSettings.put("http.proxyPort", "3128");

    Hello... I'm using this code to create a proxy... BUT how will I know
    that my program is indeed using the proxy? Is there a way? Please do
    reply . . .
     
    IveCal, May 6, 2006
    #1
    1. Advertisements

  2. IveCal

    Alex Guest

    IveCal a écrit :
    I'm using this :

    URLConnection connection;
    if (config.PROXY) {
    connection = new URL("http", config.PROXY_URL, config.PROXY_PORT,
    url).openConnection();
    } else {
    connection = new URL(url).openConnection();
    }

    and it's working fine.

    If you want to test if it's really working, you can test to
    access a webpage?
     
    Alex, May 6, 2006
    #2
    1. Advertisements

  3. IveCal

    IveCal Guest

    thanks alex... But may I know what config is? what variable is it?
     
    IveCal, May 6, 2006
    #3
  4. IveCal

    Alex Guest

    IveCal a écrit :
    it's a class where I wrote my all the parameters of my software :

    public class config {
    public static final boolean PROXY = true;
    public static final String PROXY_URL = "127.0.0.1";
    public static final int PROXY_PORT = 1234;
    }
     
    Alex, May 6, 2006
    #4
  5. IveCal

    IveCal Guest

    Ah, Ok . . . thanks a lot alex . . .
     
    IveCal, May 7, 2006
    #5
  6. IveCal

    Alex Hunsley Guest

    You could download ethereal (a network sniffer) and watch what ip/port
    your process is connecting to. Or alternatively, consider using an HTTP
    proxy like Proximotron (it's free): point your Java code at this proxy,
    and open the Proxomitron log window to see if a connection is being made
    when you think it is.
     
    Alex Hunsley, May 9, 2006
    #6
  7. IveCal

    IveCal Guest

    Thanks a lot . . . Alex . . . I'll just post questions if get some more
    errors . . .
     
    IveCal, May 11, 2006
    #7
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.