Created
April 6, 2021 23:19
-
-
Save froop/1cc673b8cbad9e5fd132d5b59696e8a5 to your computer and use it in GitHub Desktop.
[python] Slow HTTP server
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
SLEEP=5.0 | |
from BaseHTTPServer import HTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
import time | |
class Handle(SimpleHTTPRequestHandler, object): | |
def do_GET(self): | |
time.sleep(SLEEP) | |
super(Handle, self).do_GET() | |
HTTPServer(('', 80), Handle).serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment