ft_irc is a 42 school project that consists of building a basic IRC (Internet Relay Chat) server, partially compliant with the RFC 1459 specification.
The goal of this project is to gain a deeper understanding of socket programming, network protocols, multiplexing with poll, and how a multi-client chat server operates behind the scenes.
Our server supports multiple simultaneous clients, user authentication, channel creation and management, private messages, an incredible bot and more features.
To compile the project, make sure you have a C++ compiler installed and simply run:
git clone https://github.com/your-username/ft_irc.git
cd ft_irc
make1. To run the server and leave it waiting for client connections, run:
./ircserv <port> <password><port> is the port where the server listens for incoming connections.
<password> is the password that each new client must provide to authenticate with the server.
Now that the server is up and running, let's take a look at the main IRC commands supported by our server.
These commands can be typed directly in clients like Netcat or used automatically by IRC clients like HexChat.
This command is used to provide the server password upon connection.
It must be the first command sent by the client before any other.
Defines your nickname in the IRC network.
Sets the username and real name of the client.
For our server, the middle two fields can be anything (they're ignored).
Joins (or creates if it doesn't exist) a channel. Channels must start with #.
Sends a private message to a user or to a channel.
Removes a user from the channel.
Invites a user to a channel that is marked as invite-only.
Used to change the channel's settings.
+o/-o— Give/remove operator status+t/-t— Only operators can set the channel topic+l— Set a user limit+i— Set channel as invite-only+k— Set a password (key) to enter the channel
3 - Now that we know how to use the commands, we can create a connection using either Netcat or HexChat.
You can connect nc using:
- Netcat (
nc) — a simple command-line tool used to manually test the server by sending IRC commands:
nc localhost <port>- HexChat:
To connect with HexChat, simply edit the server IP and port to localhost and the port you chose when starting the server.
