*This project was created as part of the 42 curriculum by @sarherna, @artkacp, @oostapen.
This is a clean study copy — original repo: SaraitHernandez/irc_server*
ft_irc is a TCP IRC server written in C++98. It accepts multiple simultaneous clients, parses IRC-style lines (CRLF-delimited), and implements authentication, channels, private and channel messaging, and channel operator commands with modes (+i, +t, +k, +o, +l).
The goal is to understand non-blocking network I/O: a single poll() loop, non-blocking sockets, buffering of partial reads, and safe client lifecycle (connect, register, commands, disconnect).
More protocol and design detail: docs/IRC_LOGIC_AND_DATA_STRUCTURE.md and docs/TEAM_CONVENTIONS.md.
- A C++ compiler with C++98 support (
c++/clang++/g++) make- Optional:
nc(netcat) for quick manual tests; an IRC client (e.g. Halloy, irssi) for full client testing
makemake re cleans and rebuilds. The binary is ircserv.
./ircserv <port> <password>Example:
./ircserv 6667 mypasswordThe server listens on TCP IPv4 on the given port. Clients must send PASS with the configured password before NICK / USER (strict order: PASS → NICK → USER).
nc localhost 6667
PASS mypassword
NICK alice
USER alice 0 * :Alice Smith
JOIN #test
PRIVMSG #test :Hello
QUIT :Bye
With the server already running:
./tests/run_manual_tests.sh [port] [password]Defaults: port 8080, password test. See tests/MANUAL_TESTING_GUIDE.md for manual scenarios.
- macOS:
leaks --atExit -- ./ircserv 6667 test123(then exercise the server and stop it) - Linux:
valgrind --leak-check=full ./ircserv 6667 test123
| Area | Commands / behaviour |
|---|---|
| Connection | PASS, NICK, USER, PING / PONG, QUIT |
| Channels | JOIN, PART, PRIVMSG (users and channels) |
| Operators | KICK, INVITE, TOPIC, MODE |
| Modes | +i invite-only, +t topic lock, +k key, +o op, +l user limit |
Technical constraints: one poll(), non-blocking fcntl, message reassembly via a buffer, case-insensitive nick/channel matching with display case preserved.
- RFC 2812 — Internet Relay Chat: Client Protocol
- RFC 2811 — Channel Management (modes, context)
- RFC 1459 — Original IRC (historical)
- Beej’s Guide to Network Programming — sockets,
poll, error handling
- docs/TEAM_CONVENTIONS.md — module boundaries and reply formats
- docs/IRC_LOGIC_AND_DATA_STRUCTURE.md — data structures and flows
- tests/MANUAL_TESTING_GUIDE.md — evaluation-oriented test checklist
AI-assisted tools (e.g. coding assistants) were used non-exclusively for: drafting or revising documentation, brainstorming test ideas, and occasional code review or refactoring suggestions. Design decisions, protocol behaviour, and final code remain the responsibility of the authors.
This repository is part of the 42 curriculum and is intended for educational use.