ft_irc is a C++98 implementation of an IRC (Internet Relay Chat) server.
The goal of this project was to dive deep into network protocols, socket programming, and non-blocking I/O by building a custom IRC server that communicates with standard IRC clients.
IRC (Internet Relay Chat) is one of the oldest real-time messaging protocols, supporting channels, private messaging, and operators. This project helped me understand how Internet protocols work at a low level while practicing clean, efficient, and standard-compliant C++ coding.
- Handle multiple simultaneous clients with non-blocking I/O.
- Client authentication using nickname and username.
- Join and manage channels with message broadcasting.
- Private messaging between users.
- Support for channel operators with commands:
KICK→ Remove a user from a channelINVITE→ Invite a user to a channelTOPIC→ View or update a channel’s topicMODE→ Manage channel modes (invite-only, topic restriction, password, operator privileges, user limits).
- Language: C++98 (mandatory for the project).
- Compilation:
c++ -Wall -Wextra -Werror -std=c++98. - I/O Handling:
poll()(or equivalent likeselect(),kqueue(),epoll()). - Protocol: TCP/IP (IPv4 or IPv6).
- Restrictions:
- No forking.
- No external libraries or Boost.
- Clean, stable codebase required.
make./ircserv <port> <password><port>→ The port number the server will listen on.<password>→ Password required for clients to connect.
Example:
./ircserv 6667 mypass123nc -C 127.0.0.1 6667You can manually send IRC commands like:
NICK user1
USER user1 0 * :Real Name
JOIN #general
PRIVMSG #general :Hello everyone!
Connect your favorite IRC client (e.g., HexChat, irssi) to test the server.
From this project, I gained knowledge in:
- Network protocols (TCP/IP, sockets, polling).
- Real-time server-client communication.
- Non-blocking I/O and multiplexing with
poll(). - Writing robust C++ code under strict constraints (C++98, no external libs).
- Implementing standard IRC features and understanding the fundamentals of chat systems.
Mohamed Amzil
- 🌍 Portfolio
- 🐦 Twitter (X)