a lightweight encrypted chat server. clients connect over TCP, perform a Diffie-Hellman key exchange, and communicate through HMAC-authenticated encrypted frames. there are no accounts, no logs, and no persistent state beyond an optional ban list.
- E2E encryption via DH key exchange (RFC 3526 2048-bit group) + HMAC-SHA256
- multiple rooms, created on demand
- direct messages across rooms
- nicknames with server-side validation
- persistent ban list (by nickname or IP) (stored in a plain text file)
- interactive server console
./retchat [port] [bans_file]
defaults: port 6677, bans file bans.txt. the bans file is created automatically on first ban and loaded on startup if it exists.
the server accepts commands on stdin while running:
| command | desc |
|---|---|
kick <fd|nick> |
kick a client by socket fd or nickname |
ban <nick> |
ban a nickname (persisted) |
ipban <ip> |
ban an IP address (persisted) |
unban <nick> |
remove a nickname ban |
unbanip <ip> |
remove an IP ban |
list clients |
show all connected clients |
list rooms |
show all active rooms |
list bans |
show all active bans |
query client <fd> |
detail a specific client |
query room <name> |
detail a specific room |
stop |
shut down the server |
help |
show this list |
a native Android client is available at retchat-android. features a collapsible connect panel, side panel for room and DM navigation, per-conversation message history (non-persistent), and a persistent background connection via a foreground service.
a terminal client for Linux is available at retchat-linux, for those looking for a barebones client that just works (most of the time).
./retchat-client [-h host] [-p port] [-n nickname] [-r room]
default host: retucio.me, port 6677, room lobby.
client commands:
/nick <nick> change your nickname
/join <room> join a room (created if it doesn't exist)
/dm <nick> <message> send a direct message
/quit disconnect and exit
full protocol spec here.
Plain text, one entry per line:
nick:johndoe
ip:1.2.3.4
the file is read on startup and written after every ban or unban. it can be edited manually while the server is stopped.
MIT, i guess