package general;

import java.io.*;
import java.net.*;

public class Browser {
	public static void main(String args[]) throws UnknownHostException, IOException{
		Socket theSocket = new Socket("localhost", 5001);
		BufferedReader theIn = new BufferedReader(new InputStreamReader(theSocket.getInputStream()));
		
		PrintStream theOut = new PrintStream(theSocket.getOutputStream());
		
		//poser une question
		theOut.println("GET /fichier.html HTTP/1.1");
		
		//lire la réponse
		String line = theIn.readLine();
		while(line != null){
			System.out.println(line);
			line = theIn.readLine();
		}
	}
}
