How to implement Timeout in BaseHTTPServer.BaseHTTPRequestHandler Python

前端 未结 7 1267
走了就别回头了
走了就别回头了 2021-01-19 01:46

In my python script, I am trying to run a web server:

server = BaseHTTPServer.HTTPServer((\'127.0.0.1\',8080), RequestHandler)

I have a req

7条回答
  •  攒了一身酷
    2021-01-19 02:05

    class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
        timeout = 60 # StreamRequestHandler.setup
        def do_GET(self):
            # Doing Some Stuff.
    

提交回复
热议问题