Hi All,
can anyone tell me the difference between using Proxy setting at start up
and using the authManager in a test plan. I have an issue where if I use a
simple piece of code see below to access a web page it works, but through
JMeter (which I know uses the java.net. classes) to open the same URL
nothing happens.
thanks
Andrew.
URL url = new URL(urlName);
HttpURLConnection uc =
(HttpURLConnection)url.openConnection();
// the following line makes URLConnection look
like MSIE
uc.setRequestProperty("User-Agent", "Mozilla/4.0
(compatible; MSIE 5.01; Windows NT)");
uc.setRequestMethod("GET");
// the following three lines calculate a
BASE64-encoded username/password for the proxy
String userName = ""; // put your proxy/internet
username here
String passWord = ""; // put your proxy/internet
password here
String auth = "Basic " + new
sun.misc.BASE64Encoder().encode((userName + ":" + passWord).getBytes());
// comment out the following three lines to switch
off proxy access
uc.setRequestProperty("Proxy-Authorization", auth);
System.setProperty("http.proxyHost",
"proxy.xxx.xxx");
System.setProperty("http.proxyPort", "XXX");