0

我正在编写一个回显服务器,它获取 HTTP 响应消息并将其打印出来,这就是我的代码

ServerSocket s = new ServerSocket(6176);

Socket So = s.accept();

OutputStream outStream = So.getOutputStream();

Scanner in = new Scanner(So.getInputStream());
String sss = in.nextLine();
System.out.println(sss.toString());
PrintWriter out = new PrintWriter(outStream, true);

out.println(sss);
So.close();

我说的输出是:GET / HTTP/1.1

是什么原因?我错过了什么吗?

4

0 回答 0