import json, http.server, socketserver

clients = []

class CustomRequestHandler(http.server.BaseHTTPRequestHandler):
    def do_POST(self):
        if self.path == '/done_img':
            pass

    def do_GET(self):
        if self.path == '/':
            clients.append(self.client_address)
        elif self.path == '/poll':
            pass

def run():
    httpd = socketserver.TCPServer(('127.0.0.1', 8000),
                                   CustomRequestHandler)
    try:
        httpd.serve_forever()
    except KeyboardInterrupt:
        print('Closing server...')

@@ -465,16 +465,53 @@
 andler)%0A
+    httpd.allow_reuse_address = True%0A
     try:

Allow reuse address.