How to implement Timeout in BaseHTTPServer.BaseHTTPRequestHandler Python

前端 未结 7 1403
走了就别回头了
走了就别回头了 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:08

    class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
    def __init__(self, request, client_address, server):
        BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, request, client_address, server)   
        self.timeout = 60
    

提交回复
热议问题