proxy

I

IveCal

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 . . .
 
A

Alex

IveCal a écrit :
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 . . .

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?
 
A

Alex

IveCal a écrit :
thanks alex... But may I know what config is? what variable is it?

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;
}
 
A

Alex Hunsley

IveCal said:
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 . . .

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.
 
I

IveCal

Thanks a lot . . . Alex . . . I'll just post questions if get some more
errors . . .
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top