Jump to content

Client-to-client protocol

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by RobinJ1995 (talk | contribs) at 17:14, 10 October 2012. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Client-to-client protocol (CTCP) is a special type of communication between Internet Relay Chat (IRC) clients.

CTCP is a common protocol implemented by most major IRC clients in use today. CTCP extends the original IRC protocol by allowing users to query other clients or channels, this causes all the clients in the channel to reply the CTCP, for specific information. Additionally, CTCP can be used to encode messages that the raw IRC protocol would not allow to be sent over the link, such as messages containing newlines or the byte value 0 (NULL). CTCP does not establish a direct connection between clients; however, it is commonly used to negotiate DCC connections.

CTCP allows users to query a remote client about the version of the client they are using (via CTCP VERSION), the time (via CTCP TIME), or get remote user info (via CTCP USERINFO), among other things. It is also used to implement the /me command (via CTCP ACTION).

A CTCP message is implemented as a PRIVMSG or NOTICE where the first and last characters of the message are ASCII value 0x01. Additionally, characters which would not be allowed in the IRC protocol are escaped. Since a NOTICE as the standard should not generate another NOTICE as a reply, CTCP messages are sent as PRIVMSG and the reply is implemented with a NOTICE instead of a PRIVMSG.

CTCP VERSION

A CTCP VERSION request will, if the target's IRC client has been properly configured, return the name and version of the IRC client the target is using. A CTCP VERSION request is, in most IRC clients, sent as follows;
/CTCP NICKNAME VERSION
NICKNAME, in the example, should be replaced by the target's nickname.
An example of a value that could be returned is VERSION xchat 2.8.8.

See also

  • DCC (Direct Client-to-Client)