Skip to content

adiaz-uf/IRC_CHAT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IRC Server

This project is an implementation of an IRC (Internet Relay Chat) server in C++. It allows multiple clients to connect, communicate in channels, and execute various IRC commands.


Features

  • Socket Programming: Uses sockets and epoll for handling multiple clients simultaneously.
  • Client Authentication: Clients authenticate using a password, username, and nickname.
  • Channel Management: Clients can create, join, leave, and manage channels.
  • IRC Commands: Supports commands like JOIN, NICK, PRIVMSG, KICK, TOPIC, and more.
  • Bot Functionality: Includes a bot that provides jokes, the current date, and the number of connected clients.

Key Components


Supported Commands

Command Description
PASS Authenticate the client with a password.
NICK Set or change the client's nickname.
USER Set the client's username.
JOIN Join a channel or create one if it doesn't exist.
PART Leave a channel.
PRIVMSG Send a private message to a user or channel.
TOPIC Get or set the topic of a channel.
KICK Remove a user from a channel.
MODE Manage channel modes (e.g., invite-only, topic-protected).
INVITE Invite a user to a channel.
WHO List users in a channel.
QUIT Disconnect from the server.
BOT Interact with the bot (JOKE, DATE, CLIENTS).

How to Build and Run

Build

Compile the project using the Makefile:

make

Run

Start the server with a port and password:

./ircserv <port> <password>

Connect a Client

You can connect to the server using an IRC client like netcat, irssi, or a custom client.

Example using netcat:

nc localhost <port>

Authenticate the client:

PASS <password>
USER <username> 0 * <realname>
NICK <nickname>

Example Workflow

  1. Start the server:

    ./ircserv 6667 default
  2. Connect a client using netcat:

    nc localhost 6667
  3. Authenticate the client:

    PASS default
    USER myuser 0 0 0
    NICK mynick
    
  4. Join a channel:

    JOIN #mychannel
    
  5. Send a message:

    PRIVMSG #mychannel :Hello, world!
    
  6. Use the bot:

    BOT JOKE
    

Bot Commands

Command Description
JOKE Sends a random joke.
DATE Sends the current date and time.
CLIENTS Sends the number of connected clients.

About

IRC server in C++ with sockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors