*This project has been created as part of the 42 curriculum by lfirmin, jle-neze.* ## Description ft_irc is an IRC server written in C++ 98. It allows multiple clients to connect simultaneously, authenticate, join channels, and communicate in real time using the IRC protocol over TCP/IP. The server is built around a single `poll()` call with non-blocking I/O, handling all connections without forking. ## Instructions ### Compilation ``` make ``` ### Execution ``` ./ircserv ``` - `port` : the port the server listens on (e.g. 6667) - `password` : the connection password required by IRC clients ### Connecting with irssi ``` irssi /connect localhost ``` ### Connecting with netcat (for testing) ``` nc -C localhost ``` Then send commands manually: ``` PASS NICK USER 0 * : JOIN # PRIVMSG # : ``` ## Available Commands ### Registration | Command | Usage | Description | |---------|-------|-------------| | `PASS` | `PASS ` | Authenticate with the server password | | `NICK` | `NICK ` | Set or change your nickname | | `USER` | `USER 0 * :` | Set your username and realname | | `QUIT` | `QUIT` | Disconnect from the server | | `PING` | `PING ` | Ping the server, replies with PONG | ### Channels | Command | Usage | Description | |---------|-------|-------------| | `JOIN` | `JOIN # [key]` | Join or create a channel | | `PART` | `PART #` | Leave a channel | | `PRIVMSG` | `PRIVMSG # :` | Send a message to a channel | | `PRIVMSG` | `PRIVMSG :` | Send a private message to a user | ### Operator Commands | Command | Usage | Description | |---------|-------|-------------| | `KICK` | `KICK # ` | Eject a user from the channel | | `INVITE` | `INVITE #` | Invite a user to the channel | | `TOPIC` | `TOPIC #` | View the channel topic | | `TOPIC` | `TOPIC # :` | Change the channel topic | | `MODE` | `MODE # +i` | Set channel invite-only | | `MODE` | `MODE # -i` | Remove invite-only | | `MODE` | `MODE # +t` | Restrict TOPIC to operators | | `MODE` | `MODE # -t` | Remove TOPIC restriction | | `MODE` | `MODE # +k ` | Set a channel password | | `MODE` | `MODE # -k` | Remove the channel password | | `MODE` | `MODE # +o ` | Give operator privilege to a user | | `MODE` | `MODE # -o ` | Remove operator privilege from a user | | `MODE` | `MODE # +l ` | Set a user limit on the channel | | `MODE` | `MODE # -l` | Remove the user limit | ## Resources - [RFC 1459 - IRC Protocol](https://datatracker.ietf.org/doc/html/rfc1459) - [RFC 2812 - IRC Client Protocol](https://datatracker.ietf.org/doc/html/rfc2812) - [Beej's Guide to Network Programming](https://beej.us/guide/bgnet/) - [irssi documentation](https://irssi.org/documentation/) ### AI Usage Claude (claude.ai) was used during this project to: - Guide the step-by-step implementation of the Server class (socket setup, poll loop, client handling) - Explain IRC protocol concepts and numeric error codes - Help structure the Channel class and its methods - Debug compilation errors and logic issues All generated content was reviewed, understood and typed manually by the authors before being integrated into the project.