This project has been created as part of the 42 curriculum by elel-m-b, mbrouk, anlibrin.
ft_irc is a custom implementation of an Internet Relay Chat (IRC) server written in C++98 as part of the 42 curriculum.
The objective of this project is to understand how IRC works internally by implementing a server that follows the IRC protocol (RFC 1459 / RFC 2812 concepts). The server allows multiple clients to connect simultaneously, authenticate, join channels, communicate, and manage channels using IRC commands.
The server is designed to work with standard IRC clients such as irssi, allowing real-world testing without modifying the client.
- IRC server implemented in C++98
- Non-blocking sockets
- Single
poll()event loop - Multiple simultaneous clients
- Password authentication
- User registration (
PASS,NICK,USER) - Channel creation and management
- Private messaging
- Channel messaging
- Operator privileges
- Channel modes
- Compatible with standard IRC clients (e.g. irssi)
- PASS
- NICK
- USER
- PRIVMSG
- JOIN
- PART
- TOPIC
- INVITE
- KICK
- MODE
.
├── bot/
├── cmds/
├── includes/
├── srcs/
├── main.cpp
├── Makefile
├── README.md
└── ...
git clone git@github.com:elel-m-b/IRC-Server.git
cd ft_ircmakeThis generates the executable:
ircserv
./ircserv <port> <password>Example:
./ircserv 6667 mypasswordInstall irssi:
Ubuntu:
sudo apt install irssiStart irssi:
irssiConnect to the server:
/connect 127.0.0.1 6667 mypassword
Choose a nickname:
/nick alice
Join a channel:
/join #general
Send a message:
Hello everyone!
You can also test the server manually.
nc -C 127.0.0.1 6667Example registration:
PASS mypassword
NICK alice
USER alice 0 * :Alice
The server supports the mandatory channel modes required by the subject:
| Mode | Description |
|---|---|
i |
Invite-only channel |
t |
Only operators can change the topic |
k |
Password protected channel |
o |
Give/remove operator privileges |
l |
User limit |
- https://medium.com/@mohcin.ghalmi/irc-server-internet-relay-chat-bd08e4f469f8
- https://medium.com/@mohamedsarda/ft-irc-channels-and-command-management-ff1ff3758a0b
- https://www.alien.net.au/irc/irc2numerics.html
- https://modern.ircdocs.horse/
man pages
- man socket
- man bind
- man listen
- man accept
- man connect
- man recv
- man send
- man poll
irssi
Artificial Intelligence tools (ChatGPT) were used throughout the development of this project as a learning and productivity aid.
AI assistance included:
- Understanding socket programming and networking concepts.
- Explaining system calls such as
socket(),bind(),listen(),accept(),connect(),recv(),send(), andpoll().
All architecture decisions, implementation, debugging, testing, and final source code were designed, written, and validated by the project authors.
- elel-m-b
- mbrouk
- anlibrin
This project was developed for educational purposes as part of the 42 School curriculum.