Python命令: python -m SimpleHTTPServer 8000

Python代码:

import SimpleHTTPServer
import SocketServer


class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
    def handle_one_request(self):
        print(self.client_address[0])
        return SimpleHTTPServer.SimpleHTTPRequestHandler.handle_one_request(self)

print("Serving local directory")
httpd = SocketServer.TCPServer(("", 8080), MyHandler)

while True:
    httpd.handle_request()

【Python】使用 python -m SimpleHTTPServer 快速搭建http服务  测试真实访问IP地址

 

 可返回真实地址 测试web小工具

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2022-01-14
  • 2022-12-23
  • 2022-01-10
  • 2021-11-20
  • 2021-09-03
  • 2021-06-02
猜你喜欢
  • 2022-12-23
  • 2021-04-10
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
相关资源
相似解决方案