A simple Internet Relay Chat (IRC) server implementation in C++.
This project is a basic IRC server that can handle multiple clients. It's built using C++98 and uses the poll() system call to manage connections. The server listens for incoming connections on a specified port and requires a password for clients to connect.
- Handles multiple clients simultaneously using
poll(). - Client registration with
NICK,USER, andREALNAMEcommands. - Basic message receiving from clients.
To build the server, you can use the provided Makefile.
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Compile the project:
make
This will create an executable named
FT_IRC.
The Makefile also provides the following rules:
make clean: Removes the object files.make fclean: Removes the object files and theFT_IRCexecutable.make re: Rebuilds the project from scratch.
To run the server, execute the compiled binary with a port number and a password as arguments:
./FT_IRC <port> <password><port>: The port number the server will listen on (e.g., 6667).<password>: The password required for clients to connect.
Example:
./FT_IRC 6667 mysecretpasswordOnce the server is running, you can connect to it using an IRC client (like irssi, hexchat, or even netcat).
To register with the server, the client must send the following commands:
-
Set a nickname:
NICK <your_nickname> -
Set a username and realname:
USER <username> 0 * :<realname>Note: The
client.cppimplementation seems to look forREALNAMEas a separate command, which is non-standard. A standard IRC client will send the realname as part of theUSERcommand. For compatibility with this server, you might need to sendREALNAME <your_realname>if a standard client doesn't work. -
Provide the password (if required by the client):
PASS <password>
After sending these commands, the client should be registered on the server.
Last Updated: August 16, 2025