Created
April 14, 2013 12:16
-
-
Save piotr-dobrogost/5382495 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from http.server import SimpleHTTPRequestHandler | |
from http.server import HTTPServer | |
class MyRequestHandler(SimpleHTTPRequestHandler): | |
#protocol_version = "HTTP/1.0" # works | |
protocol_version = "HTTP/1.1" # hangs | |
def __init__(self, request, *args): | |
request.settimeout(3) | |
super().__init__(request, *args) | |
print(socket.getdefaulttimeout()) | |
server = HTTPServer(("localhost", 7080), MyRequestHandler) | |
server.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment