zoukankan      html  css  js  c++  java
  • 【Python】使用 python -m SimpleHTTPServer 快速搭建http服务 测试真实访问IP地址

    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小工具

  • 相关阅读:
    关于产品
    Windows服务 + Quartz.NET
    C#
    C#
    URL
    前端生态系统总结
    字符串相似度
    Process Explore & Windbg
    webpack
    JS
  • 原文地址:https://www.cnblogs.com/oscarli/p/12990949.html
Copyright © 2011-2022 走看看