/******************************************************* If you have comments please me know. Thanks you for your messages. Created by fuju@exzilla.net, Nov 1,2000. /*******************************************************/ import java.net.*; import java.io.*; import java.lang.*; public class webLoad01 { public static void main(String[] args){ String hostname=null; String proxyHost=null; URL u; URLConnection uc; String thisLine; int myCount=0; Integer myInteger=new Integer(0); String tempCount=null; if (args.length != 3){ System.out.println("Usage: webLoad01 \n"); }else{ hostname = "http://" + args[0]; proxyHost = args[1]; tempCount = args[2]; myCount = myInteger.parseInt(tempCount); System.out.println("hostname is " + hostname ); System.out.println("proxyHost is "+ proxyHost ); System.out.println("Count is " + myCount ); int myCounter=0; while (myCounter < myCount){ try { u = new URL (hostname); try { uc = u.openConnection(); //** Disable DefaultCache if (uc.getUseCaches()){ System.out.println("getUseCaches"); uc.setUseCaches(false); } String authString = "USER:PASSWORD"; String auth = "Basic " + new sun.misc.BASE64Encoder().encode(authString.getBytes()); System.getProperties().put("proxySet", "true"); System.getProperties().put("proxyHost", proxyHost); System.getProperties().put("proxyPort", "80"); uc.setRequestProperty("Proxy-Authorization", auth); // **** // DataInputStream theHTML = new DataInputStream(uc.getInputStream()); BufferedReader theHTML = new BufferedReader(new InputStreamReader(uc.getInputStream())); int count=0; try { while ((thisLine = theHTML.readLine()) != null) { System.out.println(thisLine); // Display data in text to your screen. } } catch (Exception e){ System.err.println(e); } } catch (IOException e){ System.err.println(e); } } catch (MalformedURLException e){ System.err.println(e); } myCounter++; } // end while } //end if arg } //end main(String[] args) } // end webLoad01