This project implements an Internet Relay Chat (IRC) server, a text-based communication protocol used on the Internet. Users can connect to the server and communicate with each other using a client-server model, following the protocol described in RFC 2813. This project extends a basic implementation from the 42 curriculum by adding additional functionality and using extra tools.
This project uses Makefile and CMake to build the server and test binaries. To configure and build the project, run:
makeThe server requires a port and password as command-line arguments:
port: The port the IRC server listens on for incoming connectionspassword: The password required for clients to connect
To run the server:
make runYou will be prompted to enter the required values:
Enter the port of the server: <port>
Enter the password for the server: <password>Alternatively, you can run the server directly.
./build/src/irc_server <port> <password>Reconfigure and rebuild the project:
make reTo start chatting, connect to the server using an IRC client such as Irssi. First, start the client in a terminal:
irssiAll following commands are of
irssi, therefore they may be different on the other IRC clients.
Then connect to the server:
/connect <host> <port> <password>if the client and server are running on the same machine, use
localhostas .
Command's format may vary slightly depending on the client, but they followed the protocol described in RFC 2812.
Once connected, you can send private messages:
/msg <target> <text> To chat with multiple users, join or create a channel:
/join <channel name> \[<channel key>\]Messages sent to a channel are broadcast to all users who have joined it.
Check or change your nickname:
/nick <nickname>The following commands are available only to channel operators:
/kick <channel name> <nickname> [comment]- Remove a client from the channel/invite <nickname> <channel>- Invite a client to a channel/topic <channel name> [ <topic> ]- Change or view the channel topic/mode <channel name> <(-/+)modes> <mode parameters>- Change the channel’s mode:- i: Set/remove Invite-only channel
- t: Set/remove the restrictions of the TOPIC command to channel operators
- k: Set/remove the channel key (password)
- o: Give/take channel operator privilege
- l: Set/remove the user limit to channel
These commands are specific for irssi:
/disconnect- to terminate the connection./rmreconns- to terminate the reconnections./wc- to close a tab on the terminal such as channels, private chats.