ft_irc is a custom IRC server implementation in C++98, developed as part of the 42Paris curriculum. This project deepened my understanding of network programming, TCP/IP communication, and the IRC protocol. It handles multiple clients simultaneously using non-blocking I/O and implements core IRC features.
- Client Management: Handle multiple clients simultaneously with non-blocking I/O (using
epoll/poll). - Authentication: Clients must authenticate with a password (
PASS), set a nickname (NICK), and username (USER). - Channel Operations:
- Join channels (
JOIN) - Send public/private messages (
PRIVMSG) - Channel modes: invite-only (
+i), topic restriction (+t), password-protected (+k), user limits (+l)
- Join channels (
- Operator Commands:
- Kick users from channels (
KICK) - Invite users to channels (
INVITE) - Set channel topics (
TOPIC) - Manage channel modes (
MODE)
- Kick users from channels (
- Network Protocols: TCP/IPv4 communication with support for partial data aggregation.
- Error Handling: Comprehensive IRC error responses (e.g.,
ERR_NICKNAMEINUSE,ERR_CHANOPRIVSNEEDED).
- Language: C++98
- System Calls:
socket,bind,listen,accept,poll/epoll,fcntl,recv,send - Standards: Compliant with a subset of the IRC protocol (RFC 1459)
- C++98-compatible compiler (e.g.,
g++) - GNU Make
-
Clone the repository:
git clone https://github.com/<your-username>/ft_irc.git cd ft_irc
-
Compile the project:
make
Start the server with a port and password:
./ircserv <port> <password>Connect using an IRC client (e.g., nc or irssi):
nc -C 127.0.0.1 <port>.
├── incs/ # Header files
│ ├── Monitorer.hpp # Client/channel management
│ ├── Queue.hpp # Event loop with epoll
│ ├── User.hpp # Client connection logic
│ └── ...
├── srcs/
│ ├── Monitorer.cpp # Command parsing/handling
│ ├── Queue.cpp # I/O multiplexing
│ ├── User.cpp # Client operations
│ └── responses/ # IRC response templates (e.g., RPL_WELCOME)
├── main.cpp # Server entry point
└── Makefile # Build script
- Event Loop: Uses
epollto manage non-blocking I/O operations. - Command Parsing: Extracts and processes IRC commands like
JOIN,PRIVMSG. - Channel Modes: Implements invite-only, password-protected, and operator privileges.
- Error Responses: 40+ predefined IRC error and status codes.
Developed as part of the 42Paris curriculum. Special thanks to the 42 network for providing foundational knowledge in systems programming.