浏览器客户端-自定义服务端
/*
客户端:浏览器
服务端:自定义
例如:http://222.49.250.147:11000/
*/
import java.io.*; import java.net.*; import java.lang.Exception; class HtmlServer { public static void main(String[] args) throws Exception { ServerSocket ss = new ServerSocket(11000); Socket s =ss.accept(); System.out.println(s.getInetAddress().getHostAddress()); PrintWriter out = new PrintWriter(s.getOutputStream(),true); out.println("客户端你好"); out.close(); s.close(); ss.close(); } }