메시지 형식
bash
'prefix' 'command' 'params' 'CRLF'
공백(space) 단위로 자른다.
- prefix : 서버 → 클라이언트에만 들어간다.
- command : 명령
- params : 필요에 따라 여러 개일 수 있다.
요청메시지 예시
shell
NICK MyNickName
USER MyUsername 0 * :My Real Name
JOIN #example_channel
PRIVMSG #example_channel :Hello, everyone!
QUIT :Leaving the chat
응답 메시지 예시
-
RPL_WELCOME (001) : 연결이 성공적으로 이루어졌을 때의 환영 메시지
ruby:server.example.com 001 MyNickName :Welcome to the IRC Network MyNickName!user@host -
ERR_NICKNAMEINUSE (433):
- 클라이언트가 설정하려는 닉네임이 이미 사용 중인 경우의 에러 메시지입니다.
ruby:server.example.com 433 * MyNickName :Nickname is already in use. -
RPL_TOPIC (332):
- 채널의 토픽을 알려주는 메시지입니다.
ruby:server.example.com 332 MyNickName #example_channel :This is the topic of the channel -
RPL_NAMREPLY (353):
- 채널에 현재 참여 중인 사용자 목록을 보여주는 메시지입니다.
ruby:server.example.com 353 MyNickName = #example_channel :@user1 +user2 user3 -
ERR_UNKNOWNCOMMAND (421):
- 클라이언트가 알 수 없는 명령어를 사용했을 때의 에러 메시지입니다.
ruby:server.example.com 421 MyNickName UNKNOWNCOMMAND :Unknown command