import java.io.*; import java.net.*; public class HttpLugeja{ public static void main(String argumendid[]) throws Exception{ String aadress="http://www.tpu.ee/~jaagup/"; String masin=new URL(aadress).getHost(); Socket sc=new Socket(masin, 80); BufferedReader sisse=new BufferedReader( new InputStreamReader(sc.getInputStream()) ); PrintWriter valja=new PrintWriter(sc.getOutputStream(), true); valja.println("GET "+aadress+" HTTP/1.0\n\n"); String rida=sisse.readLine(); while(rida!=null){ System.out.println(rida); rida=sisse.readLine(); } } }