A robust and efficient IRC (Internet Relay Chat) server implementation, designed for handling multiple clients and channels. This project provides a foundation for building your own chat application or understanding the inner workings of IRC servers. It supports essential IRC features like user authentication, channel management, and message handling.
- Multi-Client Support: Handles numerous concurrent client connections efficiently using
pollfor I/O multiplexing. - Channel Management: Allows creation, joining, and management of multiple channels.
- User Authentication: Implements password-based authentication for clients.
- Message Handling: Supports sending and receiving messages between clients and channels.
- Command Processing: Parses and executes standard IRC commands (e.g.,
NICK,JOIN,PRIVMSG). - Configuration: Uses a TOML file (
config.toml) for easy server configuration, including server details, authentication, and channel settings. - Signal Handling: Gracefully handles signals (SIGINT, SIGQUIT) for clean server shutdown.
- Formatted Output: Uses
Outline.hppfor visually appealing console output.
- Language: C++
- Networking: Sockets (TCP)
- I/O Multiplexing:
poll - Configuration: TOML (
config.toml) - Data Structures:
std::string,std::vector,std::set - Operating System: Linux (developed and tested on Linux / WSL2)
- Build System: c++ (GCC)
- A c++ (GCC) compiler
- Make
-
Clone the repository:
git clone https://github.com/MatriX1232/ft_irc.git cd ft_irc -
Install Dependencies (Example using apt on Debian/Ubuntu):
sudo apt update sudo apt install build-essential
Note: You may need to install a TOML parsing library separately depending on your system and chosen library.
-
Build the project:
make
-
Configure the server:
- Edit the
config.tomlfile to set the desired port, password, and other server settings. Important Security Note: Avoid storing sensitive information like passwords in plain text. Consider using environment variables or a more secure configuration management approach in a production environment.
- Edit the
-
Run the server:
./ircserv <port> <password>
Replace
<port>and<password>with the port number and password you configured inconfig.tomlor desire to use.
After starting the server, you can connect to it using an Halloy IRC client.
-
Configure your IRC client:
- Set the server address to
localhostor the IP address of the server. - Set the port to the port number you configured in
config.toml. - Enter the server password when prompted.
- Set your desired nickname, username, and real name.
- Set the server address to
-
Join channels:
- Use the
/join <channel_name>command to join a channel. For example,/join #general.
- Use the
-
Send messages:
- Type your message in the chat window and press Enter to send it to the current channel.
- Use
/msg <nickname> <message>to send a private message to another user.
This project is licensed under the MIT License - see the LICENSE file for details.