QND_secure_chat/client.py
2024-09-11 13:17:11 -05:00

15 lines
284 B
Python

import socket
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(("localhost", 9999))
done = False
while not done:
client.send(input("message: ").encode('utf-8'))
msg = client.recv(1024).decode('utf-8')
if msg != "quit":
print(msg)
else:
done = True