A simple python3 based multi-client chatroom application built over the fundamentals of sockets in python.
Developed as a part of the assessment for the module CST4045 Cross Platform Application Development at Middlesex University, London during the academic year 2019-20 under the guidance of module leader Dr Ralph Moseley.
- Core
- Multi-client
- Admin authentication for server related activites
- Full chatroom activity log
- Individual user logs
- User database w/ encrypted user passwords
- Login system for returning users
- In-chat
- Set or change preferred username
- Set or change preferred password
- Create, join or leave rooms
- List users or rooms (admin only)
- Send (encrypted) private messages
- Install dependencies
pip3 install -r requirements.txt
- Run server script
python3 chat_server.py
- Start server
- Enter port number
- Enter admin password
- Run client script
python3 chat_client.py [server_ip] [server_port]
/u [username] - Change the username
/p - Change the password
/c [room_name] - Create a new room
/j [room_name] - Join a room
/l [room_name] - Leave a room
/cd [room_name] - Change default room
/list - (Admin) List all the rooms on the server
/users - (Admin) List all the users on the server
/public <[room_name]> [message] - Sends a message to any room you are a part of
/private <[username]> [message] - Send a (encrypted) private message to any user
/logout - Disconnect from the server
There are certain known issues with respect to this code:
- After running the server script, port number for the server has to be entered; some terminals print the line asking for the port number, others just keep waiting for the input without priting the line.
- Getpass module issues a warning 'Warning: Password input may be echoed' on insecure terminals.
- Incorrect login creates a new temporary user on the server.
- The application is not yet fully compatible over the internet:
- Same encryption key is used by the server and the client which is generated and stored on the server.
- Some user validation takes place on the client side and needs to access the user database locally on the client side.
❗ The code needs refactoring. Please note that this is my first python project and was written in a matter of just few hours.