This project is a simple network chat program that allows users to send and receive messages over a local network. It includes automated library installation for required dependencies and offers an interactive console-based chat interface.
-
Clone the Repository
Clone this repository to your local machine:git clone https://github.com/mehrdadmb2/TCPChatClientServer.git cd TCPChatClientServer
Then, run the following command:
pip install -r requirements.txt
-
Install Dependencies
The program includes an automatic library downloader. If any libraries are missing, the downloader will attempt to install them for you.Required Libraries:
socket
threading
colorama
-
Run the Program
Start the chat server and client:python Send_MSG(A).py
python Send_MSG(B).py
To customize the program, you may need to modify the following settings in the code:
- SERVER_HOST: The IP address to listen on. Defaults to
0.0.0.0
. - SERVER_PORT: The port the server will use to listen for incoming connections. Default is
8080
. - CLIENT_PORT: The port the client will use to connect. Default is
8082
. - TARGET_IP: Set the IP address of the target device you wish to connect to. (Adjust this to match the network configuration)
Example:
# Configuration (Adjust according to your setup)
SERVER_HOST = "0.0.0.0" # Replace with your desired IP for server listening
SERVER_PORT = 8080 # Replace with your desired port for server listening
CLIENT_PORT = 8082 # Replace with your desired port for client connection
TARGET_IP = "192.168.1.102" # Replace with the target IP address for sending messages
Run the script on the device you wish to set up as the server. The server will listen for incoming connections on the specified SERVER_HOST
and SERVER_PORT
.
Run the script on a different device, specifying the TARGET_IP
and CLIENT_PORT
for the connection. Enter messages in the console to communicate with the server.
Type exit
in the client console to terminate the connection.
- Automatic Library Downloader: The program will check for required libraries and install them automatically if they are not already installed.
- Clear Console: Cross-platform command to clear the console screen (compatible with Windows and Linux).
- Message Log: Displays incoming and outgoing messages in different colors for easier readability.
Distributed under the MIT License. See NOPEEEE
for more information.
NOOOOOO Licensessss XD
Mehrdad - game.developer.mb@gmail.com
Project Link: https://github.com/mehrdadmb2/TCPChatClientServer
Special thanks to the open-source contributors for Colorama and other essential Python libraries.
### توضیحات:
- بخش مربوط به `Install Dependencies` بهروز شده و اطلاعات مربوط به `requirements.txt` اضافه شده است.
- حالا کاربران میتوانند به راحتی کتابخانههای مورد نیاز را نصب کنند.