Reading — step 1 of 5
Read
~1 min readIRC Basics
Client Registration
When a client connects, it must REGISTER before sending other commands:
C: NICK alice
C: USER alice 0 * :Alice Smith
S: :irc.example.com 001 alice :Welcome ...
- NICK: 9-char-max nickname. Must be unique on the network.
- USER: username (typically ident-style), mode-bits, unused, real name (in trailing param).
Server replies:
- 001 RPL_WELCOME
- 002 RPL_YOURHOST
- 003 RPL_CREATED
- 004 RPL_MYINFO (server, version, modes)
- 005 RPL_ISUPPORT (capability negotiation in older form)
- ... and the MOTD (Message of the Day).
Modern: capability negotiation via IRCv3:
C: CAP LS 302
S: CAP * LS :sasl multi-prefix server-time message-tags
C: CAP REQ :sasl message-tags
S: CAP * ACK :sasl message-tags
C: AUTHENTICATE PLAIN
S: AUTHENTICATE +
C: AUTHENTICATE <base64 PLAIN credentials>
S: 903 alice :SASL authentication successful
C: CAP END
C: NICK alice
C: USER alice 0 * :Alice
CAP REQ asks for capabilities; ACK confirms. SASL provides authenticated NICK before registration completes.
Errors during registration:
- 432 ERR_ERRONEOUSNICKNAME: invalid characters.
- 433 ERR_NICKNAMEINUSE: someone else has this nick.
- 461 ERR_NEEDMOREPARAMS: command missing required args.
- 462 ERR_ALREADYREGISTRED: trying to NICK/USER twice.
- 451 ERR_NOTREGISTERED: command before registration.
After registration:
- Client can JOIN, PRIVMSG, etc.
- Client must respond to PING with PONG to stay connected.
Identity:
- nick: visible name, can change via /nick.
- user: ident, fixed for session.
- host: client's hostname (or cloak).
- Combined:
nick!user@hostis the userhost mask.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…