ft_irc is a project that involves developing an IRC server that allows multiple clients to connect, authenticate, and communicate through private and public channels. The implementation follows the IRC protocol using TCP/IP communication.This project is about creating your own IRC server using C++ 98. You will use an actual IRC client to connect to your server and test its functionality.
- The server must use non-blocking I/O (poll or equivalent).
- No forking is allowed.
- The following system functions are authorized:
socket,close,setsockopt,bind,connect,listen,accepthtons,htonl,ntohs,ntohl,inet_addr,inet_ntoasend,recvsignal,sigactionpoll(or equivalent likeselect(),kqueue(),epoll())lseek,fstat,fcntl
- External libraries and Boost libraries are forbidden.
- The server must be started as:
./ircserv <port> <password> <port>: The port number the server listens on.<password>: The required password for client authentication.
-
SSH:
git clone https://github.com/kellyhayd/ft_irc.git ircserv cd ircserv make ./ircserv <port> <password>
-
Valgrind output saved in valgrind_out.txt after:
ulimit -n 1024 # necessary once only, to address 'file descriptor too high' error make valgrind
-
The server should:
- Support multiple clients simultaneously.
- Handle non-blocking I/O operations using a single poll() (or equivalent).
- Maintain proper communication between the server and connected clients via TCP/IP.
- Work seamlessly with a real IRC client.
-
The following core IRC functionalities must be implemented:
- Authentication, setting a nickname and username.
- Joining and communicating in channels.
- Sending and receiving private messages.
- Message broadcasting to all channel members.
- User roles: Operators and regular users.
-
Implementing operator-specific commands:
KICK- Ejects a client from a channel.INVITE- Invites a client to a channel.TOPIC- Changes or views the channel topic.MODE- Modifies channel settings:i- Invite-only mode.t- RestrictsTOPICchanges to operators.k- Sets/removes a channel password.o- Grants/removes operator privileges.l- Sets/removes a user limit.
-
The server must handle malformed requests and partial data reception.
-
Ensure that the server aggregates packets correctly before processing a command.
- The server must handle malformed requests and partial data reception.
- Ensure that the server aggregates packets correctly before processing a command.
- IRC bot that can automate tasks. QuoteBot send a random quote when called by "!quote"
- https://reactive.so/post/42-a-comprehensive-guide-to-ft_irc/ (high-level guide)
- https://en.wikipedia.org/wiki/IRC
- https://modern.ircdocs.horse/ (official IRC protocol guide)
- https://stackoverflow.com/questions/10654286/why-should-i-use-non-blocking-or-blocking-sockets
- https://libera.chat/
- IRC God Blog about the ft_irc by 42 students
- Medium ft_irc
- Channels and Command Management
- TCP Server Creating the basic of a TCP server
- Network Programming Sockets