This project has been created as part of the 42 curriculum by nofelten, ccauderl and acohaut.
nofelten, ccauderl & acohaut
(piscine of september's 2025 - 42 PARIS)
starting date : 16/09/2026
last update : 22/10/2026
This project is about to create our own IRC server !
We have to use an actual IRC client to connect to our server and test it.
The Internet is governed by solid standard protocols that allow connected computers to interact with each other. So, it's always beneficial to understand these protocols.
We based our project mainly on RFC 1459 that explains all about Internet Relay Chat Protocol.
Skills learning / improvement :
- Understanding TCP/IP communication between client and server.
- Implementing non-blocking I/O operations and multiplexing with poll().
- Writing clean code that complies with the C++ 98 standard.
- Strengthening computational thinking, problem-solving, and collaboration.
- Coding a moderation bot from scratch
Usage
- Run "make" to compile the source files using the provided Makefile. You can run "make bonus" to compile the IRC server and its moderation bot.
- Execute the server by running :
./ircserv <port> <password>.In another terminal, execute the bot by running :
./ircbot <ip> <port> <password> <bot name> <nb_of_warnings>- Connect to the server using your reference IRC client. You can also test the connection manually using :
nc 127.0.0.1 <port>- Then follow these instructions :
PASS <password of the server>
NICK <your nickname>
USER <username> <hostname> <servername> <realname>- Examples of possible commands (channel name must begin by '&' or '#'):
JOIN <channel name>
PRIVMSG <user nickname> <message>- After joining a channel invite the bot :
INVITE <bot name> <channel name>After this the bot will moderate the channel based on the dictionary given in bonus/resources. If a user has too many warnings for bad language, it will be kicked from the channel.
Check leaks
valgrind --leak-check=full --show-leak-kinds=all ./ircserv "port" "password"
Tips for adding \r or \n in commands
- CTRL + V + M = \r
- CTRL + V + J = \n
RFC 1459 - IRC Protocol : (https://datatracker.ietf.org/doc/html/rfc1459)
French ft_irc github project : (https://github.com/raveriss/ft_irc)
Creating a TCP Server in C++ : (https://www.youtube.com/watch?v=cNdlrbZSkyQ&list=PLHBVNH27RbWqGTL-AYMylWkNck45cxPnG)
C++ Networking : (https://www.youtube.com/watch?v=gntyAFoZp-E&list=PLHBVNH27RbWqGTL-AYMylWkNck45cxPnG&index=3)
Other ressources : Githubs and IA -> for researches and understanding concepts or examples usages for functions allowed by the subject