from threading import Thread
from socketserver import ThreadingMixIn
from http.server import HTTPServer, BaseHTTPRequestHandler

PORT1 = 8088
PORT2 = 8087

class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        url=self.path[1:]
        print("the request is from:",self.client_address)
        print("the request is served by :",self.server)
        print("URL:",url)
        if url == "hello":
            self.send_response(200)
            self.send_header("Content-type", "text/plain")
            self.end_headers()
            self.wfile.write(bytes("Echo to "+str(self.client_address)+ " from "+str(self.server.server_address), "utf-8"))
        else:
            self.send_response(404)
        
            

class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
    daemon_threads = True

def serve_on_port(port):
    server = ThreadingHTTPServer(("",port), Handler)
    server.serve_forever()

Thread(target=serve_on_port, args=[PORT1]).start()
serve_on_port(PORT2)
c8ca1c91d94e2b28e562f237f9bc53716b601293
<mask token>


class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
    daemon_threads = True


<mask token>

<mask token>


class Handler(BaseHTTPRequestHandler):

    def do_GET(self):
        url = self.path[1:]
        print('the request is from:', self.client_address)
        print('the request is served by :', self.server)
        print('URL:', url)
        if url == 'hello':
            self.send_response(200)
            self.send_header('Content-type', 'text/plain')
            self.end_headers()
            self.wfile.write(bytes('Echo to ' + str(self.client_address) +
                ' from ' + str(self.server.server_address), 'utf-8'))
        else:
            self.send_response(404)


class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
    daemon_threads = True


def serve_on_port(port):
    server = ThreadingHTTPServer(('', port), Handler)
    server.serve_forever()


Thread(target=serve_on_port, args=[PORT1]).start()
serve_on_port(PORT2)

<mask token>
PORT1 = 8088
PORT2 = 8087


class Handler(BaseHTTPRequestHandler):

    def do_GET(self):
        url = self.path[1:]
        print('the request is from:', self.client_address)
        print('the request is served by :', self.server)
        print('URL:', url)
        if url == 'hello':
            self.send_response(200)
            self.send_header('Content-type', 'text/plain')
            self.end_headers()
            self.wfile.write(bytes('Echo to ' + str(self.client_address) +
                ' from ' + str(self.server.server_address), 'utf-8'))
        else:
            self.send_response(404)


class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
    daemon_threads = True


def serve_on_port(port):
    server = ThreadingHTTPServer(('', port), Handler)
    server.serve_forever()


Thread(target=serve_on_port, args=[PORT1]).start()
serve_on_port(PORT2)

from threading import Thread
from socketserver import ThreadingMixIn
from http.server import HTTPServer, BaseHTTPRequestHandler
PORT1 = 8088
PORT2 = 8087


class Handler(BaseHTTPRequestHandler):

    def do_GET(self):
        url = self.path[1:]
        print('the request is from:', self.client_address)
        print('the request is served by :', self.server)
        print('URL:', url)
        if url == 'hello':
            self.send_response(200)
            self.send_header('Content-type', 'text/plain')
            self.end_headers()
            self.wfile.write(bytes('Echo to ' + str(self.client_address) +
                ' from ' + str(self.server.server_address), 'utf-8'))
        else:
            self.send_response(404)


class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
    daemon_threads = True


def serve_on_port(port):
    server = ThreadingHTTPServer(('', port), Handler)
    server.serve_forever()


Thread(target=serve_on_port, args=[PORT1]).start()
serve_on_port(PORT2)

from threading import Thread
from socketserver import ThreadingMixIn
from http.server import HTTPServer, BaseHTTPRequestHandler

PORT1 = 8088
PORT2 = 8087

class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        url=self.path[1:]
        print("the request is from:",self.client_address)
        print("the request is served by :",self.server)
        print("URL:",url)
        if url == "hello":
            self.send_response(200)
            self.send_header("Content-type", "text/plain")
            self.end_headers()
            self.wfile.write(bytes("Echo to "+str(self.client_address)+ " from "+str(self.server.server_address), "utf-8"))
        else:
            self.send_response(404)
        
            

class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
    daemon_threads = True

def serve_on_port(port):
    server = ThreadingHTTPServer(("",port), Handler)
    server.serve_forever()

Thread(target=serve_on_port, args=[PORT1]).start()
serve_on_port(PORT2)