A simple multi-user chat application to learn the python socket library.
You should have Python 3.3 to install and use virtualenv.
$ pip install virtualenv
# Put your current python version here. For this example, I will use 3.8
$ python3.8 -m venv multiuser-chat
$ .\venv\Scripts\activate
To run the project, you will require a server to receive and send packets to connected clients and clients that will see the messages broadcasted by the server.
# You can choose your own port number, for this example I chose 3490
$ python chat-server.py 3490
To create a client, start another terminal and run this command:
# If you are running this on your own computer the host will usually be localhost
$ python chat-client.py [nickname] [host] [port_number]
- Beej's Guide to Network Concepts
- This is the main resource I read to learn low-level networking concepts and write python code to work with networks.
- Socket Programming HOWTO
- Article from official documentation to get a better understanding of what sockets are.