Skip to content

takato7/IRCserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

223 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRC server


Description

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.


Instructions

This project uses Makefile and CMake to build the server and test binaries. To configure and build the project, run:

make

The server requires a port and password as command-line arguments:

  • port: The port the IRC server listens on for incoming connections
  • password: The password required for clients to connect

To run the server:

make run

You 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 re

Examples

Connect to the server

To start chatting, connect to the server using an IRC client such as Irssi. First, start the client in a terminal:

irssi

All 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 localhost as .

Basic commands

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>

Channel operator commands

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

Useful Irssi commands

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.

About

IRC server in C++ handling multiple client connections concurrently using a non-blocking I/O event loop.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors