This is a simple implementation of the original IRC protocol.
IRC stands for Internet Relay Chat. In its purest form, IRC has completely ephemeral messages: the server is not responsible for keeping a message history or even timestamping messages. The main function of the server is to relay messages sent by one client to its recipients. These recipients can be specified manually for direct messaging, or are determined by the channel that the message is being sent on. Popular chat services Discord and Slack drew inspiration from IRC, and IRC channels and DMs largely play the same role as channels and DMs on these more mainstream platforms.
While this particular server does not support the feature at the moment, IRC also supports relaying messages to other IRC servers. A collection of servers connected this way is called an IRC network, and is how IRC is mostly used today. Popular networks include Freenode and Rizon.
This server supports
- Channels
- Direct messages
Support for relaying messages to other servers is planned.
- Tech stack
- Language: C (with GCC compiler)
- Libraries: POSIX and C standard library routines for networking, I/O, and dynamic memory
- Build system: Make
- Client information is stored in a linked list. This information includes:
- File descriptors
- Identification information (nickname, username, hostname)
- Client state (whether they have just connected, are in the process of registering themselves, or have finished registration and are ready to talk)
- Channels are implemented as an associative linked list
- Many-to-many relationship between clients and channels.
- This server uses
selectfor its I/O multiplexing. This was done for simplicity and better support (MacOS and BSD don't come withepoll), but comes with the following limitations:- When any number of clients sends data, the server has to loop over all clients currently connected to determine which one it was
selectcan handle no more than 1024 clients.
Customize config.h. Then run make.