Skip to content

This is the Chat Server Application made using Python. It contains multiple commands like LOGIN, MSG, WHO, DM, PING, etc. which can be used by the active users to communicate with each other and gaining the information about the different users.

License

Notifications You must be signed in to change notification settings

ashutosh229/chat_sever_application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Socket Chat Server

Overview

A multi-user TCP chat server using Python sockets and threads.
Implements:

  • LOGIN
  • MSG
  • WHO
  • DM
  • PING → PONG
  • Idle timeout + disconnect notifications

⚙️ Setup

  1. Install Python 3.8+
  2. Clone or copy this project:
   git clone <your-repo> socket-chat
   cd socket-chat
  1. Run the server
python3 chat_server.py  
  1. Connect two or more clients using either of the two ways:
    A. Netcat:
nc localhost 4000
LOGIN Alice
MSG Hello everyone!  

B. Python client:

python3 chat_client.py --host 127.0.0.1 --port 4000  

🧠 Example Session

Client 1:

LOGIN ashutosh
OK
MSG hello everyone...how are all of you?  

Client 2:

LOGIN shristi
OK
MSG hey ashutosh!

🧪 Optional Commands

Command Description
WHO Lists active users
DM <username> <text> Sends a private message to the specified user
PING Replies with PONG
ERR Returned on invalid input
INFO <username> disconnected Shown when someone leaves the chat

🧰 Demo Video

Watch the working demo here: Demo

About

This is the Chat Server Application made using Python. It contains multiple commands like LOGIN, MSG, WHO, DM, PING, etc. which can be used by the active users to communicate with each other and gaining the information about the different users.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages