Switcher is a project developed in Python that implements a server and clients that communicate with each other via sockets. Clients can send messages to other clients connected through the server, and the server is responsible for redirecting these messages to the correct recipient. Additionally, Switcher allows sending messages to all connected clients simultaneously.
- Multiple Connections: Support for multiple clients connected at the same time.
- Message Redirection: The server redirects messages to the correct client.
- Messages to All Clients: Ability to send messages to all connected clients.
- Multithreading: Uses multithreading to handle multiple client connections efficiently.
- Python 3.x
-
Clone this repository to your local machine:
git clone https://github.com/MatiasMuniz/switcher.git
-
Navigate to the project directory:
cd switcher
-
(Optional) Create and activate a virtual environment:
python -m venv switcher_env source switcher_env/bin/activate # On Linux/Mac switcher_env\Scripts\activate # On Windows
Run the server using the following command:
python server.py
Run one or more clients using the following command:
python client.py
Messages should be in the following format:
IP:DEST@PORT:CONTENT
- IP: IP of the sender.
- DEST@PORT: IP address and port of the recipient. Use all@all to send the message to all clients.
- CONTENT: Content of the message.
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007