Linux代理服务器编写

编写一个Linux代理服务器
访问baidu这个网站时,返回状态码ok,其它的网站就不行,返回404或者301


[xxx@localhost ~]$ telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET http://www.zhihu.com/ HTTP/1.1
HTTP/1.1 404 Not Found
Content-Length: 0
X-NWS-LOG-UUID: 10128066344326777660
Connection: close
Server: D0
Date: Sat, 27 May 2023 08:39:03 GMT
X-Cache-Lookup: Return Directly

Connection closed by foreign host.
[xxx@localhost ~]$ telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET http://www.csu.edu.cn/ HTTP/1.0
HTTP/1.1 404 Not Found
Server: Apache
Content-Type: text/html; charset=utf-8
Content-Length: 235
Connection: close

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL  was not found on this server.</p>
<hr>
<address>Apache  Server</address>
</body></html>Connection closed by foreign host.

  • 这篇博客: 渗透测试信息收集中的 baidu 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
  • 大致相同

    精确匹配
    《》 ""