import java.io.* ; import java.net.* ; // This "Browser" is rather boring. It just prints out the // HTML *source* of the course home-page. public class TrivialBrowser { public static void main(String [] args) throws Exception { String host = "aspen.csit.fsu.edu" ; Socket sock = new Socket(host, 80); PrintWriter out = new PrintWriter(new OutputStreamWriter(sock.getOutputStream())); out.println("GET /it1fall00/index.html HTTP/1.0") ; out.println("") ; out.flush() ; BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream())); while(true) { String line = in.readLine(); if(line == null) break ; System.out.println(line) ; } } }