The IRC protocol is a text-based protocol, with the simplest client being any socket program capable of connecting to the server.
The IRC network is like a Spanning tree, where each server is a central node ofr the rest the network it sees.
- Client
A client is anything connecting to a server that is not another server.
* Nickname (Unique & MAX 9 Chars);
* Username;
* Hostname;
- Channel
A channel is a named group of one or more clients which will all receive messages addressed to that channel.
* First Client to join = Channel Operator = Creates the Channel;
* Channel Endes when the last Client leaves;
* Messages are sent to all Clients in the Channel;
* Channel's Name begin with '&' or '#' and MAX of 200 chars.
* Channel's Name may NOT contain spaces(' '). control G(^G or ASCII 7), or commas (',');
- Operators
Operators are a special type od clients, with more privilegies. This aims to keep the order in an IRC network.
Channel Operators (also referred to as a chop or chanop and identified by the '@' symbol) have special COMMANDS:
KICK - Eject a client from the channel
MODE - Change the channel's mode
> About -p and -s : "Both can’t be set together. And uppon setting one mode, the other one is automatically unset."
INVITE - Invite a client to an invite-only channel (mode +i)
TOPIC - Change the channel topic in a mode +t channel
-
Messages
* Comunication is essentially asynchronous (meaning, Clients should not wait for a Reply from the Server.) * Messages are always terminated with Carriage Return - Line Feed and they should NOT exceed 512 chars. * Server must parse the entire message and return appropriate errors. * All Parameters must be check for validity.
Divided in 3 Main Parts:
-
Prefix (Opcional)
- Indicated using a colon (':') (ex: ':isousa') *No whitespaces between the ':' and the prefix.
- Used to indicate the origin of the message.
- If there is no prefix, Server will assume it is originated from the connection it was received.
- If the source can't be found (ex: prefix dont match any user) or if the source is different than the link it arrived from, the message should be ignored.
-
Command
- Valid IRC command or a 3 digit number.
-
Command Parameters (MAX 15)
-
Difference between private and secret channel
/nick <nick> - set nick on current server
/set irc.server_default.nicks <nick> - set default nick dor every server
/set irc.server.[SERVER_NAME].nicks <nick> - set default nick for target server
Install WeeChat:
sudo apt install weechat