M
moonhk
Below program worked before. How to program with proxy with input User
name and password ?
import java.util.*;
import java.io.*;
import java.net.*;
public class eproxy_tofile {
public static void main(String[] args) {
Properties prop = System.getProperties();
prop.put("http.proxyHost","xx.xx.40.20");
prop.put("http.proxyPort","8081");
try {
String Addr = "http://www.new-alliance.com/Naam_NAV.htm";
URL yahoo = new URL(Addr);
System.out.println("Conneting ... " + Addr);
BufferedReader in = new BufferedReader(new InputStreamReader
(yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) !=null)
System.out.println(inputLine);
in.close();
}
catch (Exception exc) {
exc.printStackTrace();
}
}
}
name and password ?
import java.util.*;
import java.io.*;
import java.net.*;
public class eproxy_tofile {
public static void main(String[] args) {
Properties prop = System.getProperties();
prop.put("http.proxyHost","xx.xx.40.20");
prop.put("http.proxyPort","8081");
try {
String Addr = "http://www.new-alliance.com/Naam_NAV.htm";
URL yahoo = new URL(Addr);
System.out.println("Conneting ... " + Addr);
BufferedReader in = new BufferedReader(new InputStreamReader
(yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) !=null)
System.out.println(inputLine);
in.close();
}
catch (Exception exc) {
exc.printStackTrace();
}
}
}