Skip to content

A simple Internet Relay Chat (IRC) client implemented in C++98. The goal of this project is to provide a basic yet functional IRC client that allows users to connect to IRC servers, join channels, send and receive messages, and interact with other users in real-time.

License

Notifications You must be signed in to change notification settings

myousaf64/IRC-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

172 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_irc – Internet Relay Chat Server

πŸ“˜ Summary

A simple Internet Relay Chat (IRC) client implemented in C++98. The goal of this project is to provide a basic yet functional IRC client that allows users to connect to IRC servers, join channels, send and receive messages, and interact with other users in real-time.


Note

to test ft_irc run the tester:

# run the executable before running the tester
./ircserv <PORT> > <yourpassword>
./irc_test.sh <PORT> > <yourpassword>

🧱 Requirements

General

  • No crashes or unexpected quits.
  • Must include a Makefile with rules: $(NAME), all, clean, fclean, re.
  • Must compile with: c++ -Wall -Wextra -Werror -std=c++98.
  • Use C++ equivalents of C functions where possible.
  • No external libraries (including Boost).
  • No forking. All I/O must be non-blocking.
  • Must use exactly one poll() (or equivalent) to handle all I/O.
  • Communication must happen over TCP/IP (IPv4 or IPv6).

πŸ› οΈ Build and Run

  • Executable name: ircserv

  • Run as:

    ./ircserv <port> <password>
  • Acceptable source files:

    • .cpp, .h, .hpp, .tpp, .ipp, optional config file

πŸ”Œ Networking Functions Allowed

You can use: Everything in C++ 98. socket, close, setsockopt, getaddrinfo, freeaddrinfo, bind, connect, listen, accept, htons, ntohs, send, recv, signal, fcntl, getsockname, getprotobyname, gethostbyname, htonl, ntohl, sigaction, lseek, fstat, poll (or equivalent).


πŸ§‘β€πŸ€β€πŸ§‘ Required Features

Your server must:

  • Support multiple clients simultaneously.

  • Allow clients to:

    • Authenticate (with password)
    • Set nickname and username
    • Join channels
    • Send/receive private and channel messages
  • Forward all messages sent in a channel to all other participants.

  • Distinguish between operators and regular users.

IRC Commands to Implement

  • User commands:
    • NICK, USER, JOIN, PRIVMSG, etc.
  • Channel operator commands:
    • KICK: Eject user from channel
    • INVITE: Invite a user to a channel
    • TOPIC: View or change channel topic
    • MODE (with sub-modes):
      • i: Invite-only channel
      • t: Topic can only be changed by ops
      • k: Channel key (password)
      • o: Give/take operator status
      • l: User limit for the channel

πŸ“Œ Implementation Tips

  • Handle partial reads/writes (e.g. messages arriving in segments).
  • Parse and rebuild full commands before processing.
  • The reference client should connect and work without errors, just like with a real IRC server.

🎁 Bonus (only if mandatory part is perfect)

Optional features:

  • File transfers
  • IRC bot

βœ… Test Example (Manual Test)

Using netcat:

nc -C 127.0.0.1 6667

Type input like:

com
man
d

(using Ctrl+D to simulate broken-up message delivery).

Useful Links

About

A simple Internet Relay Chat (IRC) client implemented in C++98. The goal of this project is to provide a basic yet functional IRC client that allows users to connect to IRC servers, join channels, send and receive messages, and interact with other users in real-time.

Topics

Resources

License

Stars

Watchers

Forks

Contributors