import socket
import time
with socket.socket() as s:
    host = 'localhost'
    port = 8001
    s.bind((host, port))
    print(f'Server socket binded to {port}')
    s.listen()
    con, addr = s.accept()
    with con:
        while True:
            data = con.recv(1024)
            if not data:
                break
            con.sendall(data)
