Echo server and client using python socket
To develop a simple webserver to serve html programming pages.
Design of echo server and client using python socket
Implementation using Python code
Testing the server and client
import socket
HOST, PORT = '127.0.0.1', 65432
with socket.create_connection((HOST, PORT)) as s:
s.sendall(b'Naresh kumar R, 212224040213')
print(f'Received: {s.recv(1024)!r}')
import socket
host,port='127.0.0.1',65432
with socket.create_server((host,port))as s:
conn,addr=s.accept()
with conn:
print(f'connected by {addr}')
while data :=conn.recv(1024):
conn.sendall(data)
The program is executed successfully

