English | Русский
A decentralized peer-to-peer chat written in C, built on top of UDP with non-blocking I/O.
Features:
- Connect to a single peer and the chat automatically discovers and joins the rest of the network.
- Activity tracking — peers that stop answering pings are considered disconnected.
- Pseudo-graphical Midnight Commander–style interface, with colors and message timestamps.
- Per-user nicknames (up to 12 characters).
- Messages limited to 60 characters, with a live counter shown above the input.
- Slash commands:
/help,/who,/clear,/quit.
git clone --depth=1 https://github.com/gistrec/C-P2P-Chat.git
cd C-P2P-Chat
cmake -S . -B build
cmake --build build -- -j 2Ubuntu / Debian:
sudo apt-get install cmake libncursesw5-devmacOS (Homebrew):
brew install cmake ncursesMore details: installing ncurses, installing CMake.
| Flag | Description |
|---|---|
-n, --name <nick> |
Nickname (required) |
-l, --local-port <port> |
Local port (default 8888) |
-r, --remote-host <ip> |
IP of a peer to connect to |
-p, --remote-port <port> |
Peer port (default 8888) |
-h, --help |
Show usage |
Example:
./build/C_P2P_Chat --name Alice --remote-host 46.180.227.50 --remote-port 8888 --local-port 8080- Chat commands.
- Color support.
