Skip to content

Instantly share code, notes, and snippets.

@squarism
Created August 26, 2021 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save squarism/4c405433d6d24bb98964f90d28c33f7b to your computer and use it in GitHub Desktop.
Save squarism/4c405433d6d24bb98964f90d28c33f7b to your computer and use it in GitHub Desktop.
A Nice Webserver
# You probably have python3 on a linux box you have lying around
# Save this as nice_webserver.py
# Run me with python3 nice_webserver.py
# It doesn't do anything bad, read it below
import socketserver
import time
class Server(socketserver.BaseRequestHandler):
def handle(self):
time.sleep(3200000000) # 100 years, give or take
with socketserver.TCPServer(("localhost", 9001), Server) as srv:
srv.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment