一个简单的聊天室
- 首先启动服务端
python3 server.py 127.0.0.1 port
- 启动客户端
python3 client.py [client_host] [client_port] [server_host] [server_port]
例如
python client.py 127.0.0.1 2223 127.0.0.1 2222
- 设置username和password
username: mki
password: mki
- 选择chat mode
b:(broadcast) 群聊 所有用户可见
s:(solo) 私聊 仅选择用户可见
l:(list all users) 显示所有在线用户
e:(exit) 退出chatroom