Skip to content

shahdscode/socketChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clientServerSocketChat

A client-server chat application built with Python sockets and Tkinter. Supports multiple clients, TLS encryption, private chats, message persistence, and heartbeat keep-alive.

Project Structure

clientServerSocketChat/
├── app/
│   ├── common/
│   │   ├── constants.py      # Shared constants (serverPort, heartbeatInterval, ...)
│   │   └── protocol.py       # Length-prefixed sendMsg / recvMsg helpers
│   ├── database/
│   │   └── databaseManager.py
│   ├── server/
│   │   └── chatServer.py
│   └── client/
│       └── chatClient.py
├── tests/
│   └── test_e2e.py
├── data/                     # SQLite database (created at runtime)
├── certs/                   # TLS certificates (auto-generated)
├── server.py                # Server entry point
├── client.py                # Client entry point
└── requirements.txt

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Run

Start the server (GUI dashboard):

python server.py

Start a client (repeat for multiple users):

python client.py

Commands

Command Description
/list Show online users
@username message Request a private chat
yes / no Accept or reject a private chat invitation
exit / quit Leave a private chat session
disconnect / bye Disconnect from the server

Environment Variables

Variable Default Description
USE_TLS 1 Enable TLS encryption
REQUIRE_TLS 0 Reject non-TLS connections
TLS_CERT certs/server.crt Certificate path
TLS_KEY certs/server.key Private key path

Tests

USE_TLS=0 python -m pytest tests/ -v

About

Real-time Python socket chat app with Tkinter GUI, TLS encryption, private messaging, SQLite persistence, and multi-client support.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages