PackagenetTest;ImportJava.io.*;Importjava.net.*; Public classIE { Public Static voidMain (string[] args)throwsException {Socket s=NewSocket ("127.0.0.1", 8080); PrintWriter out=NewPrintWriter (S.getoutputstream (),true); Out.println ("Get/myweb/demo.html http/1.1"); Out.println ("Accept: */*"); Out.println ("host:127.0.0.1:11188"); Out.println ("Connection:keep-alive"); Out.println (); Out.println (); BufferedReader BUFR=NewBufferedReader (NewInputStreamReader (S.getinputstream ())); String Line=NULL; while(line = Bufr.readline ())! =NULL) {System.out.println (line); } } }
PackagenetTest;ImportJava.io.*;Importjava.net.*; Public classIE { Public Static voidMain (string[] args)throwsException {Socket s=NewSocket ("127.0.0.1", 8080); PrintWriter out=NewPrintWriter (S.getoutputstream (),true); Out.println ("Get/myweb/demo.html http/1.1"); Out.println ("Accept: */*"); Out.println ("host:127.0.0.1:11188"); Out.println ("Connection:keep-alive"); Out.println (); Out.println (); BufferedReader BUFR=NewBufferedReader (NewInputStreamReader (S.getinputstream ())); String Line=NULL; while(line = Bufr.readline ())! =NULL) {System.out.println (line); } } }
Network Programming (custom graphical interface browser-tomcat server). Request to simulate IE