This project has been created as part of the 42 curriculum by ieddaoud, mgarouj, ielouarr.
ft_irc is an implementation of a simplified Internet Relay Chat (IRC) server written in C++98. The objective of the project is to understand network programming, socket communication, multiplexing with poll(), and the IRC protocol defined by RFC 1459.
The server accepts multiple TCP client connections simultaneously and allows users to communicate through private messages and channels using a subset of the IRC protocol. The project emphasizes low-level networking, event-driven programming, client management, and protocol parsing.
The server is compatible with standard IRC clients (such as HexChat or irssi) and supports the mandatory commands and channel management features required by the 42 subject.
- TCP server
- Multiple clients simultaneously
- Non-blocking sockets
poll()-based event loop- Password authentication
- PASS
- NICK
- USER
- JOIN
- TOPIC
- INVITE
- KICK
- MODE
- PRIVMSG
+iInvite-only channel+tTopic protection+kChannel password+oOperator privilege+lUser limit
The server implements the appropriate numeric replies and error messages defined by RFC 1459 whenever applicable.
.
├── Client/
├── Commands/
├── Headers/
├── Server/
├── Channel/
├── main.cpp
├── Makefile
└── README.md
- C++98 compiler
- Make
makeThe executable produced is:
ircserv
./ircserv <port> <password>Example:
./ircserv 6667 password42Example using HexChat:
- Create a new network.
- Set the server to:
127.0.0.1/6667
- Set the server password to the password used when launching the server.
- Connect.
After connecting, you can use commands such as:
/join #42
/topic #42 :Welcome to ircserv
/invite Ali #42
/kick Ali Spamming
Create a channel:
/join #42
Set the topic:
/topic #42 :Welcome to the channel
Invite another user:
/invite Ali #42
Kick a user:
/kick Ali :Spamming
Send a private message:
- C++98 only
- No external libraries
- Event-driven architecture using
poll() - One server process
- Non-blocking sockets
- Modular command handlers
- Channel and client management separated into dedicated classes
- RFC 1459 — Internet Relay Chat Protocol https://datatracker.ietf.org/doc/html/rfc1459
- Beej's Guide to Network Programming https://beej.us/guide/bgnet/
- cppreference https://en.cppreference.com/
Artificial Intelligence was used as a learning and debugging assistant throughout the development of this project.
It was primarily used for:
- Understanding and interpreting error messages during compilation and runtime
- Helping identify the possible causes of bugs based on error messages
All architectural decisions, implementation, testing, debugging, and final source code were completed and validated by the project authors.
- ieddaoud
- mgarouj
- ielouarr