ft_irc

A fully functional Internet Relay Chat (IRC) server written in C++98, capable of handling multiple concurrent clients, channels, and operators.

2022-03-01

low-levelOpen GitHub
ft_irc

ft_irc

An IRC server written in C++98 that handles multiple clients simultaneously over a single non-blocking event loop. Any standard IRC client works with it: irssi, WeeChat, HexChat. Clients authenticate with a password, join channels, and communicate in real time.

No forking. Everything runs in one process through poll().

Features

  • Non-blocking I/O with a single poll() loop for all connected clients
  • Password authentication on connect
  • Full channel management: JOIN, PART, TOPIC, KICK, INVITE, MODE
  • Private messaging with PRIVMSG and NOTICE
  • Operator commands: kick users, set modes, manage topics
  • Built-in bot with !time, !help, and !topic commands

Channel modes

ModeWhat it does
+iInvite-only
+tOnly operators can change the topic
+kPassword-protected channel
+lUser count limit
+oGrant or revoke operator status

Technical notes

All sockets are non-blocking. Partial reads and writes are handled gracefully. Messages are buffered per client until a full \r\n-terminated line arrives. Written in C++98, no modern features.

Usage

make
./ircserv 6667 mysecretpassword
 
# Connect with irssi
/connect localhost 6667 mysecretpassword
/nick mynick
/join #general

SCREENSHOTS // 01 FRAMES

Screenshot 1
01 / 01