Hassan Ed-dybNotesFR

ft_irc

A chat server, from raw sockets.

ft_irc — A chat server, from raw sockets.

An IRC server built from scratch: multiple clients, channels, private messages and the core commands of RFC 2812, on raw socket programming.

The problem

IRC still runs real communities and works with any standard client. Writing a compatible server means handling many connections at once and following a protocol to the letter.

How I built it

  1. 01One server process that handles many clients at once over TCP sockets.
  2. 02Message parsing and the core commands: NICK, JOIN, PART, PRIVMSG, QUIT and more.
  3. 03Channels where groups chat, plus private messages between users, usable from standard IRC clients.

Key takeaways

  • — Reading and implementing an RFC: interoperability comes from following the spec.
  • — Serving many connections from one process without letting one client hold up the others.

ft_irc was built as part of the software engineering curriculum at 1337 Coding School (42 Network, UM6P), where every project is built from scratch and reviewed by peers.