Connecting to the server with an IRC client, irssi:
Internet Relay Chat or IRC is a text-based communication protocol on the Internet.
The goal of this project is to build a fully functional IRC server from scratch, following the RFC 2812 specifications, allowing multiple IRC clients to connect, join channels, and communicate in real-time, either publicly or privately.
The server accepts and handles connections from multiple clients using sockets and never hangs. It supports private messaging and public chatrooms and enforces user authentication and nickname registration. All I/O operations are non-blocking and the communication between client and server uses TCP/IPv4.
These commands are supported by the server:
PRIVMSG: Sends a private message to a user or channelINVITE: Invites a user to join a specific channelNAMES: Lists the users in a channel or all visible users on the serverTOPIC: Sets or retrieves the topic of a channelERROR: Indicates an error message sent by the serverJOIN: Joins a user to a specified channelKICK: Removes a user from a channelMODE: Changes or queries channel/user modes (permissions or settings)MOTD: Retrieves the "Message of the Day" from the serverNICK: Sets or changes the user's nicknameOPER: Grants operator (admin) privileges to a userPART: Leaves a specified channelPASS: Sends a password to authenticate with the serverPING: Tests the connection to the server or another clientPONG: Response to aPINGcommand to keep the connection aliveQUIT: Disconnects from the server, optionally with a messageUSER: Provides the username and real name during login
This my second to last project at Hive Helsinki. From this project I gained valuable knowledge and skills in Network Programming, Protocol Implementation, Concurrency and Team Collaboration.
- Object-oriented programming
- Networking
- Internet protocols
- Concurrency and asynchronous I/O
- Client-server architecture
- Teamwork
- Error handling and security
- Parsing and string manipulation
- C++
- Makefile
See the above GIF for reference!
git clone https://github.com/kenlies/42ft_irccd 42ft_ircmake./ircserv <port> <password>- then on another terminal, open your favourite IRC client:
irssi - connect to the server with:
/connect 127.0.0.1 <port> <password> /join <channel>to join a public room
The bonus section added two features. One of them was file transfer, which was easy to implement due to the design of the PRIVMSG command—it worked almost out of the box. The other feature was a bot, which tells jokes and can leave when necessary. I know, such a useful bot!
The bot could've been made more useful. Better documentation and additional comments in code would be an improvement.