标签:handler self pre direct client res ddr rect imp
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()
可返回真实地址 测试web小工具
使用 python -m SimpleHTTPServer 快速搭建http服务 测试真实访问IP地址
标签:handler self pre direct client res ddr rect imp
原文地址:https://www.cnblogs.com/oscarli/p/12990949.html