A minimal chat room written in modern C++17 on top of Winsock 2 using socket programming and multi-threading. Everything runs in a Windows console and uses ANSI escape sequences for coloured nicknames.
# Server
g++ -std=c++17 -Wall -pthread server.cpp -o server.exe -lws2_32
# Client
g++ -std=c++17 -Wall client.cpp -o client.exe -lws2_32- Launch the server in one terminal:
server.exe
- Open additional terminals and start as many clients as you would like:
client.exe
- Type your messages and watch them pop up in chat. Type #exit to leave the chat
common.hpp- ANSI helpers and colour pickerserver.cpp- Multithreaded chat server (one thread per client)client.cpp- Lightweight terminal client
