openfractal-client-space / fake_space_server.py
hadim's picture
WIP
d3b7a29
raw
history blame
552 Bytes
import http.server
PORT = 7860
class MyHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write(b"The manager is running.")
server = None
try:
server = http.server.HTTPServer(("0.0.0.0", PORT), MyHandler)
print("Started http server")
server.serve_forever()
except KeyboardInterrupt:
print("^C received, shutting down server")
if server is not None:
server.socket.close()