private static void testProxy() {
try {
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
"221.130.13.38", 80));
URL url = new URL("http://flybull.yfyf.net/addispatcher.htm");
HttpURLConnection uc = (HttpURLConnection) url
.openConnection(proxy);
uc.connect();
StringBuffer tmp = new StringBuffer();
BufferedReader in = new BufferedReader(new InputStreamReader(uc
.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
Saturday, April 17, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment