├── lib
├── addstyle.sed
├── style-special.css
└── style.css
├── .gitignore
├── README.md
├── draft-oakley-irc-client-latest.mkd
├── dist
├── draft-oakley-irc-client-latest.txt
├── draft-oakley-irc-client-latest.xml
├── draft-oakley-irc-client-latest.html
└── draft-oakley-irc-ctcp-latest.txt
├── draft-oakley-irc-ctcp-latest.mkd
├── versions
└── ctcp
│ ├── draft-oakley-irc-ctcp-00.mkd
│ ├── draft-oakley-irc-ctcp-01.mkd
│ ├── draft-oakley-irc-ctcp-02.mkd
│ ├── draft-oakley-irc-ctcp-00.txt
│ └── draft-oakley-irc-ctcp-01.txt
└── info
├── grawity-sasl-20150304.md
└── rfc2810.txt
/lib/addstyle.sed:
--------------------------------------------------------------------------------
1 | /
15 | g
16 | }
17 | # Save the last line for later.
18 | /<\/style>/h
19 | d
20 | }
21 | # This recovers a saved line and prints it.
22 | x
23 | /<\/style>/{
24 | s/.*<\/style>//
25 | p
26 | }
27 | x
28 |
29 |
--------------------------------------------------------------------------------
/lib/style-special.css:
--------------------------------------------------------------------------------
1 | /* my special additions to the default I-D template style */
2 |
3 | /* I like open-sans, sorta riffing on the style I'm using on modern already */
4 | @import url('https://modern.ircdocs.horse/css/open-sans.css');
5 | body {
6 | font: 16px/22px "Open Sans", sans-serif;
7 | }
8 | #title, h1, h2, h3, h4, h5, h6 {
9 | font-family: "Open Sans", sans-serif;
10 | }
11 |
12 | /* I'll only do these for screen viewing because they do expand the text.
13 | and leaving the doc smoller for printing feels sensible/responsible. */
14 | @media screen {
15 | /* give the text and headings some more room to breathe */
16 | p + p {
17 | margin-top: 11px;
18 | }
19 | h2 {
20 | margin-top: 20px;
21 | }
22 | h3 {
23 | margin-top: 20px;
24 | }
25 |
26 | /* make the pre boxes feel more open and happier */
27 | pre {
28 | padding: 8px 5px;
29 | border-radius: 4px;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### Windows ###
2 | # Windows image file caches
3 | Thumbs.db
4 | ehthumbs.db
5 |
6 | # Folder config file
7 | Desktop.ini
8 |
9 | # Recycle Bin used on file shares
10 | $RECYCLE.BIN/
11 |
12 | # Windows Installer files
13 | *.cab
14 | *.msi
15 | *.msm
16 | *.msp
17 |
18 | # Windows shortcuts
19 | *.lnk
20 |
21 |
22 | ### OSX ###
23 | .DS_Store
24 | .AppleDouble
25 | .LSOverride
26 |
27 | # Icon must end with two \r
28 | Icon
29 |
30 |
31 | # Thumbnails
32 | ._*
33 |
34 | # Files that might appear in the root of a volume
35 | .DocumentRevisions-V100
36 | .fseventsd
37 | .Spotlight-V100
38 | .TemporaryItems
39 | .Trashes
40 | .VolumeIcon.icns
41 |
42 | # Directories potentially created on remote AFP share
43 | .AppleDB
44 | .AppleDesktop
45 | Network Trash Folder
46 | Temporary Items
47 | .apdisk
48 |
49 |
50 | ### Linux ###
51 | *~
52 |
53 | # KDE directory preferences
54 | .directory
55 |
56 | # Linux trash folder which might appear on any partition or disk
57 | .Trash-*
58 |
59 |
60 | ### IRC ###
61 | /.refcache/
62 | /src/middle.xml
63 | /src/back.xml
64 | tracker.log
65 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IRC RFCs
2 |
3 | I'm trying to write an update to the outdated [RFC 1459](https://tools.ietf.org/html/rfc1459) and [RFC 2812](https://tools.ietf.org/html/rfc2812) specifications.
4 |
5 | Newest builds are available here:
6 |
7 |
8 | - IRC CTCP: [HTML](https://cdn.jsdelivr.net/gh/ircdocs/irc-rfcs@master/dist/draft-oakley-irc-ctcp-latest.html) / [Text](https://cdn.jsdelivr.net/gh/ircdocs/irc-rfcs@master/dist/draft-oakley-irc-ctcp-latest.txt) (I'll fix the html link a bit later, the txt link works though)
9 |
10 | The 'drafts' in this repo are mostly based off my [Modern docs](https://modern.ircdocs.horse/). The CTCP I-D is something I'm working on, but the IRC Client Protocol document is probably not going to be worked on for a very long time (I think that info's better conveyed in the [Modern doc](https://modern.ircdocs.horse/) and more recent documentation attempts like [devdocs](https://dd.ircdocs.horse)).
11 |
12 |
13 | ## Why?
14 |
15 | RFC 1459 and RFC 2812 are the first place that new IRC software authors look when they want to implement IRC. And why wouldn't they – those are the latest RFCs for it!
16 |
17 | However, IRC has changed a lot since those specs were published. Today, there are many different documents that you need to look at to fully understand how the protocol works in practice. I've got a page [here](https://ircdocs.horse/specs/) that tries to go through the useful ones, and [this living specification](https://modern.ircdocs.horse/) which attempts to produce a workable spec to use day-to-day.
18 |
19 | However, having an updated specification that's gone through the IETF process and is a proper RFC would:
20 |
21 | - Help us standardise the defacto solutions that have been in use for years, and prevent fragmentation from those by newer software.
22 | - Give people a better core standard which they can refer to, which is an RFC and describes the protocol as it really works.
23 |
24 | These documents don't describe things that will be, or things that should happen after the spec is published. These documents describe how things work right now in specific detail.
25 |
26 |
27 | ## Documents
28 |
29 | I'm going to split this into a few separate documents, each describing a separate part of IRC as it stands today. Here, I'll go through what each one covers, what it explicitly doesn't, and the status of it.
30 |
31 | ### Client Protocol
32 |
33 | This is the big one, the replacement for RFC 1459 and RFC 2812 on the whole. It'll probably include:
34 |
35 | - Core client protocol.
36 | - `RPL_ISUPPORT`
37 | - Basic message tags (at least describing them as part of the IRC framing).
38 |
39 | This document is being actively worked on as the main [Modern Client Protocol Doc](https://modern.ircdocs.horse/). I'm **not working on the client protocol spec here** until that linked Modern document is at a point where I'm relatively happy removing the WIP tag from it.
40 |
41 |
42 |
43 | ### Client-to-Client Protocol (CTCP)
44 |
45 | This describes how CTCP works today, ignoring a lot of the quoting that was specified in older documents but not actually implemented by any widely-used clients. It describes:
46 |
47 | - Core CTCP protocol.
48 | - Commonly-used or seen CTCP messages.
49 |
50 | I'm **working on this document currently**, most of that work being copyediting and editing in general. I'm thinking about using this as a 'test bed' for seeing how I can go getting clients to look over and validate it, and for seeing how the IETF responds to IRC specifications.
51 |
52 | [HTML](https://rawgit.com/DanielOaks/irc-rfcs/master/dist/draft-oakley-irc-ctcp-latest.html) / [Text](https://rawgit.com/DanielOaks/irc-rfcs/master/dist/draft-oakley-irc-ctcp-latest.txt)
53 |
54 |
55 | ## S2S Note
56 |
57 | The server to server protocol is explicitly not being covered here.
58 |
59 | [RFC 2812](https://tools.ietf.org/html/rfc2812) says the following: "At the time of writing, the only current implementation of this protocol is the IRC server, version 2.10". Today, that's not the case. You have lots and lots of different IRCds, and lots of different server protocols in use because of it. TS6, a bunch of custom TS6 flavours, TS5, P10, InspIRCd's protocol. We're primarily aiming to document and specify what is being used today, and there simply isn't a single server protocol in use today.
60 |
61 | Especially given that there are servers (and competing IRC protocol efforts) experimenting with topologies other than the standard spanning-tree, and even their own newly-designed protocols between servers, I don't think it makes sense to try to specify a new version of the server protocol at this point. I think it's best to leave this to server authors themselves and relevant server spec documents sometime later as the technology grows and experiments, as what we specify would probably just be ignored or quickly become irrelevant.
62 |
63 |
64 | ## Building
65 |
66 | To build this, install [kramdown-rfc2629](https://github.com/cabo/kramdown-rfc2629) and then use the relevant `build-*.sh` script. That script will put the xml, txt and html files in the `dist/` directory.
67 |
68 | As noted below, when submitting changes only include the source file changes. Don't include the newly-built `dist/` changes. This helps when merging and resolving conflicts.
69 |
70 |
71 | ## Contributing
72 |
73 | When putting in a pull request, ***ONLY*** submit a change for the source files. ***DO NOT*** include the new `dist/` files in your pull request. This is to prevent a million conflicts if we have three PRs sitting in the waiting queue and try to merge all of them at once (particularly the .txt files). We can generate new `dist/` files after we merge things into the repo.
74 |
75 | **NOTE:** `lib/addstyle.sed` and `lib/style.css` have been taken from Martin Thompson's [I-D Template](https://github.com/martinthomson/i-d-template) repository.
76 |
--------------------------------------------------------------------------------
/draft-oakley-irc-client-latest.mkd:
--------------------------------------------------------------------------------
1 | ---
2 | coding: utf-8
3 |
4 | title: Internet Relay Chat Client Protocol
5 | abbrev: irc-client
6 | docname: draft-oakley-irc-client-latest
7 |
8 | submissionType: independent
9 | category: info
10 |
11 | stand_alone: yes
12 | pi: [toc, sortrefs, symrefs, comments]
13 |
14 | obsoletes: 1459, 2810, 2811, 2812
15 |
16 | author:
17 | -
18 | ins: D. Oakley
19 | name: Daniel Oakley
20 | role: editor
21 | org: ircdocs
22 | email: daniel@danieloaks.net
23 | -
24 | ins: J. Allnutt
25 | name: Jack Allnutt
26 | org: Kiwi IRC
27 | email: jack@allnutt.eu
28 |
29 | --- abstract
30 |
31 | The Internet Relay Chat (IRC) protocol has been designed over a number of years, with multitudes of implementations and use cases appearing. This document describes the IRC Client-Server protocol.
32 |
33 | IRC is a text-based chat protocol which has proven itself valuable and useful. It is well-suited to running on many machines in a distributed fashion. A typical setup involves multiple servers connected in a distributed network. Messages are delivered through this network and state is maintained across it for the connected clients and active channels.
34 |
35 | --- middle
36 |
37 | # Introduction
38 |
39 | The Internet Relay Chat (IRC) protocol has been designed over a number of years, with multitudes of implementations and use cases appearing. This document describes the IRC Client-Server protocol.
40 |
41 | IRC is a text-based chat protocol which has proven itself valuable and useful. It is well-suited to running on many machines in a distributed fashion. A typical setup involves multiple servers connected in a distributed network. Messages are delivered through this network and state is maintained across it for the connected clients and active channels.
42 |
43 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in {{!RFC2119}}.
44 |
45 |
46 | # IRC Concepts
47 |
48 | This section describes concepts behind the implementation and organisation of the IRC protocol, which are useful in understanding how it works.
49 |
50 |
51 | ## Architectural
52 |
53 | A typical IRC network consists of servers and clients connected to those servers, with a good mix of IRC operators and channels. This section goes through each of those, what they are and a brief overview of them.
54 |
55 | ### Servers
56 |
57 | Servers form the backbone of IRC, providing a point to which clients may connect and talk to each other, and a point for other servers to connect to, forming an IRC network.
58 |
59 | The most common network configuration for IRC servers is that of a spanning tree, where each server acts as a central node for the rest of the network it sees. Other topologies are being experimented with, but right there are no others widely used in production.
60 |
61 | ~~~
62 | [ Server 15 ] [ Server 13 ] [ Server 14 ]
63 | / \ /
64 | / \ /
65 | [ Server 11 ] ------ [ Server 1 ] [ Server 12 ]
66 | / \ /
67 | / \ /
68 | [ Server 2 ] [ Server 3 ]
69 | / \ \
70 | / \ \
71 | [ Server 4 ] [ Server 5 ] [ Server 6 ]
72 | / | \ /
73 | / | \ /
74 | / | \____ /
75 | / | \ /
76 | [ Server 7 ] [ Server 8 ] [ Server 9 ] [ Server 10 ]
77 |
78 | :
79 | [ etc. ]
80 | :
81 | ~~~
82 | {: #figops artwork-align="center" title="Format of a typical IRC network"}
83 |
84 | There have been several terms created over time to describe the roles of different servers on an IRC network. Some of the most common terms are as follows:
85 |
86 | - **Hub**: A hub is a server that connects to multiple other servers. For instance, in the figure above, Server 2, Server 3, and Server 4 would be examples of hub servers.
87 | - **Core Hub**: A core hub is typically a hub server that connects fairly major parts of the IRC network together. What is considered a core hub will change depending on the size of a network and what the administrators of the network consider important. For instance, in the figure above, Server 1, Server 2, and Server 3 may be considered core hubs by the network administrators.
88 | - **Leaf**: A leaf is a server that is only connected to a single other server on the network. Typically, leafs are the primary servers that handle client connections. In the figure above, Servers 7, 8, 10, 13, 14, and others would be considered leaf servers.
89 | - **Services**: A services server is a special type of server that extends the capabilities of the server software on the network (ie, they provide *services* to the network). Services are not used on all networks, and the capabilities typically provided by them may be built-into server software itself rather than being provided by a separate software package. Features usually handled by services include client account registration (as are typically used for SASL authentication), channel registration (allowing client accounts to 'own' channels), and further modifications and extensions to the IRC protocol. 'Services' themselves are **not** specified in any way by the protocol. What they provide depends entirely on the software packages being run.
90 |
91 | A trend these days is to hide the real structure of a network from regular users. Networks that implement this may restrict or modify commands like `MAP` so that regular users see every other server on the network as linked directly to the current server. When this is done, servers that do not handle client connections may also be hidden from users (hubs hidden in this way can be called 'hidden hubs'). Generally, IRC operators can always see the true structure of a network.
92 |
93 | These terms are not generally used in IRC protocol documentation, but may be used by the administrators of a network in order to differentiate the servers they run and their roles.
94 |
95 |
--------------------------------------------------------------------------------
/dist/draft-oakley-irc-client-latest.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Network Working Group D. Oakley, Ed.
6 | Internet-Draft ircdocs
7 | Obsoletes: 1459, 2810, 2811, 2812 (if J. Allnutt
8 | approved) Kiwi IRC
9 | Intended status: Informational May 28, 2017
10 | Expires: November 29, 2017
11 |
12 |
13 | Internet Relay Chat Client Protocol
14 | draft-oakley-irc-client-latest
15 |
16 | Abstract
17 |
18 | The Internet Relay Chat (IRC) protocol has been designed over a
19 | number of years, with multitudes of implementations and use cases
20 | appearing. This document describes the IRC Client-Server protocol.
21 |
22 | IRC is a text-based chat protocol which has proven itself valuable
23 | and useful. It is well-suited to running on many machines in a
24 | distributed fashion. A typical setup involves multiple servers
25 | connected in a distributed network. Messages are delivered through
26 | this network and state is maintained across it for the connected
27 | clients and active channels.
28 |
29 | Status of This Memo
30 |
31 | This Internet-Draft is submitted in full conformance with the
32 | provisions of BCP 78 and BCP 79.
33 |
34 | Internet-Drafts are working documents of the Internet Engineering
35 | Task Force (IETF). Note that other groups may also distribute
36 | working documents as Internet-Drafts. The list of current Internet-
37 | Drafts is at http://datatracker.ietf.org/drafts/current/.
38 |
39 | Internet-Drafts are draft documents valid for a maximum of six months
40 | and may be updated, replaced, or obsoleted by other documents at any
41 | time. It is inappropriate to use Internet-Drafts as reference
42 | material or to cite them other than as "work in progress."
43 |
44 | This Internet-Draft will expire on November 29, 2017.
45 |
46 | Copyright Notice
47 |
48 | Copyright (c) 2017 IETF Trust and the persons identified as the
49 | document authors. All rights reserved.
50 |
51 | This document is subject to BCP 78 and the IETF Trust's Legal
52 | Provisions Relating to IETF Documents
53 |
54 |
55 |
56 | Oakley & Allnutt Expires November 29, 2017 [Page 1]
57 |
58 | Internet-Draft irc-client May 2017
59 |
60 |
61 | (http://trustee.ietf.org/license-info) in effect on the date of
62 | publication of this document. Please review these documents
63 | carefully, as they describe your rights and restrictions with respect
64 | to this document.
65 |
66 | Table of Contents
67 |
68 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
69 | 2. IRC Concepts . . . . . . . . . . . . . . . . . . . . . . . . 2
70 | 2.1. Architectural . . . . . . . . . . . . . . . . . . . . . . 2
71 | 2.1.1. Servers . . . . . . . . . . . . . . . . . . . . . . . 3
72 | 3. Normative References . . . . . . . . . . . . . . . . . . . . 4
73 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 4
74 |
75 | 1. Introduction
76 |
77 | The Internet Relay Chat (IRC) protocol has been designed over a
78 | number of years, with multitudes of implementations and use cases
79 | appearing. This document describes the IRC Client-Server protocol.
80 |
81 | IRC is a text-based chat protocol which has proven itself valuable
82 | and useful. It is well-suited to running on many machines in a
83 | distributed fashion. A typical setup involves multiple servers
84 | connected in a distributed network. Messages are delivered through
85 | this network and state is maintained across it for the connected
86 | clients and active channels.
87 |
88 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
89 | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
90 | document are to be interpreted as described in [RFC2119].
91 |
92 | 2. IRC Concepts
93 |
94 | This section describes concepts behind the implementation and
95 | organisation of the IRC protocol, which are useful in understanding
96 | how it works.
97 |
98 | 2.1. Architectural
99 |
100 | A typical IRC network consists of servers and clients connected to
101 | those servers, with a good mix of IRC operators and channels. This
102 | section goes through each of those, what they are and a brief
103 | overview of them.
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | Oakley & Allnutt Expires November 29, 2017 [Page 2]
113 |
114 | Internet-Draft irc-client May 2017
115 |
116 |
117 | 2.1.1. Servers
118 |
119 | Servers form the backbone of IRC, providing a point to which clients
120 | may connect and talk to each other, and a point for other servers to
121 | connect to, forming an IRC network.
122 |
123 | The most common network configuration for IRC servers is that of a
124 | spanning tree, where each server acts as a central node for the rest
125 | of the network it sees. Other topologies are being experimented
126 | with, but right there are no others widely used in production.
127 |
128 | [ Server 15 ] [ Server 13 ] [ Server 14 ]
129 | / \ /
130 | / \ /
131 | [ Server 11 ] ------ [ Server 1 ] [ Server 12 ]
132 | / \ /
133 | / \ /
134 | [ Server 2 ] [ Server 3 ]
135 | / \ \
136 | / \ \
137 | [ Server 4 ] [ Server 5 ] [ Server 6 ]
138 | / | \ /
139 | / | \ /
140 | / | \____ /
141 | / | \ /
142 | [ Server 7 ] [ Server 8 ] [ Server 9 ] [ Server 10 ]
143 |
144 | :
145 | [ etc. ]
146 | :
147 |
148 | Figure 1: Format of a typical IRC network
149 |
150 | There have been several terms created over time to describe the roles
151 | of different servers on an IRC network. Some of the most common
152 | terms are as follows:
153 |
154 | o *Hub*: A hub is a server that connects to multiple other servers.
155 | For instance, in the figure above, Server 2, Server 3, and Server
156 | 4 would be examples of hub servers.
157 |
158 | o *Core Hub*: A core hub is typically a hub server that connects
159 | fairly major parts of the IRC network together. What is
160 | considered a core hub will change depending on the size of a
161 | network and what the administrators of the network consider
162 | important. For instance, in the figure above, Server 1, Server 2,
163 | and Server 3 may be considered core hubs by the network
164 | administrators.
165 |
166 |
167 |
168 | Oakley & Allnutt Expires November 29, 2017 [Page 3]
169 |
170 | Internet-Draft irc-client May 2017
171 |
172 |
173 | o *Leaf*: A leaf is a server that is only connected to a single
174 | other server on the network. Typically, leafs are the primary
175 | servers that handle client connections. In the figure above,
176 | Servers 7, 8, 10, 13, 14, and others would be considered leaf
177 | servers.
178 |
179 | o *Services*: A services server is a special type of server that
180 | extends the capabilities of the server software on the network
181 | (ie, they provide _services_ to the network). Services are not
182 | used on all networks, and the capabilities typically provided by
183 | them may be built-into server software itself rather than being
184 | provided by a separate software package. Features usually handled
185 | by services include client account registration (as are typically
186 | used for SASL authentication), channel registration (allowing
187 | client accounts to 'own' channels), and further modifications and
188 | extensions to the IRC protocol. 'Services' themselves are *not*
189 | specified in any way by the protocol. What they provide depends
190 | entirely on the software packages being run.
191 |
192 | A trend these days is to hide the real structure of a network from
193 | regular users. Networks that implement this may restrict or modify
194 | commands like "MAP" so that regular users see every other server on
195 | the network as linked directly to the current server. When this is
196 | done, servers that do not handle client connections may also be
197 | hidden from users (hubs hidden in this way can be called 'hidden
198 | hubs'). Generally, IRC operators can always see the true structure
199 | of a network.
200 |
201 | These terms are not generally used in IRC protocol documentation, but
202 | may be used by the administrators of a network in order to
203 | differentiate the servers they run and their roles.
204 |
205 | 3. Normative References
206 |
207 | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
208 | Requirement Levels", BCP 14, RFC 2119,
209 | DOI 10.17487/RFC2119, March 1997,
210 | .
211 |
212 | Authors' Addresses
213 |
214 | Daniel Oakley (editor)
215 | ircdocs
216 |
217 | Email: daniel@danieloaks.net
218 |
219 |
220 |
221 |
222 |
223 |
224 | Oakley & Allnutt Expires November 29, 2017 [Page 4]
225 |
226 | Internet-Draft irc-client May 2017
227 |
228 |
229 | Jack Allnutt
230 | Kiwi IRC
231 |
232 | Email: jack@allnutt.eu
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 | Oakley & Allnutt Expires November 29, 2017 [Page 5]
281 |
--------------------------------------------------------------------------------
/dist/draft-oakley-irc-client-latest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Internet Relay Chat Client Protocol
17 |
18 |
19 | ircdocs
20 |
21 | daniel@danieloaks.net
22 |
23 |
24 |
25 | Kiwi IRC
26 |
27 | jack@allnutt.eu
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | The Internet Relay Chat (IRC) protocol has been designed over a number of years, with multitudes of implementations and use cases appearing. This document describes the IRC Client-Server protocol.
41 |
42 | IRC is a text-based chat protocol which has proven itself valuable and useful. It is well-suited to running on many machines in a distributed fashion. A typical setup involves multiple servers connected in a distributed network. Messages are delivered through this network and state is maintained across it for the connected clients and active channels.
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | The Internet Relay Chat (IRC) protocol has been designed over a number of years, with multitudes of implementations and use cases appearing. This document describes the IRC Client-Server protocol.
57 |
58 | IRC is a text-based chat protocol which has proven itself valuable and useful. It is well-suited to running on many machines in a distributed fashion. A typical setup involves multiple servers connected in a distributed network. Messages are delivered through this network and state is maintained across it for the connected clients and active channels.
59 |
60 | The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in .
61 |
62 |
63 |
64 |
65 | This section describes concepts behind the implementation and organisation of the IRC protocol, which are useful in understanding how it works.
66 |
67 |
68 |
69 | A typical IRC network consists of servers and clients connected to those servers, with a good mix of IRC operators and channels. This section goes through each of those, what they are and a brief overview of them.
70 |
71 |
72 |
73 | Servers form the backbone of IRC, providing a point to which clients may connect and talk to each other, and a point for other servers to connect to, forming an IRC network.
74 |
75 | The most common network configuration for IRC servers is that of a spanning tree, where each server acts as a central node for the rest of the network it sees. Other topologies are being experimented with, but right there are no others widely used in production.
76 |
77 |
98 |
99 | There have been several terms created over time to describe the roles of different servers on an IRC network. Some of the most common terms are as follows:
100 |
101 |
102 | Hub: A hub is a server that connects to multiple other servers. For instance, in the figure above, Server 2, Server 3, and Server 4 would be examples of hub servers.
103 | Core Hub: A core hub is typically a hub server that connects fairly major parts of the IRC network together. What is considered a core hub will change depending on the size of a network and what the administrators of the network consider important. For instance, in the figure above, Server 1, Server 2, and Server 3 may be considered core hubs by the network administrators.
104 | Leaf: A leaf is a server that is only connected to a single other server on the network. Typically, leafs are the primary servers that handle client connections. In the figure above, Servers 7, 8, 10, 13, 14, and others would be considered leaf servers.
105 | Services: A services server is a special type of server that extends the capabilities of the server software on the network (ie, they provide services to the network). Services are not used on all networks, and the capabilities typically provided by them may be built-into server software itself rather than being provided by a separate software package. Features usually handled by services include client account registration (as are typically used for SASL authentication), channel registration (allowing client accounts to ‘own’ channels), and further modifications and extensions to the IRC protocol. ‘Services’ themselves are not specified in any way by the protocol. What they provide depends entirely on the software packages being run.
106 |
107 |
108 | A trend these days is to hide the real structure of a network from regular users. Networks that implement this may restrict or modify commands like MAP so that regular users see every other server on the network as linked directly to the current server. When this is done, servers that do not handle client connections may also be hidden from users (hubs hidden in this way can be called ‘hidden hubs’). Generally, IRC operators can always see the true structure of a network.
109 |
110 | These terms are not generally used in IRC protocol documentation, but may be used by the administrators of a network in order to differentiate the servers they run and their roles.
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 | Key words for use in RFCs to Indicate Requirement Levels
130 |
131 |
132 | In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
203 |
204 |
205 |
206 |
--------------------------------------------------------------------------------
/draft-oakley-irc-ctcp-latest.mkd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Internet Relay Chat: Client-to-Client Protocol (CTCP)"
3 | abbrev: IRC CTCP
4 | docname: draft-oakley-irc-ctcp-latest
5 | category: info
6 | updates: 1459, 2812
7 |
8 | ipr: trust200902
9 | submissionType: independent
10 |
11 | stand_alone: yes
12 | pi:
13 | rfcedstyle: yes
14 | toc: yes
15 | tocindent: yes
16 | sortrefs: yes
17 | symrefs: yes
18 | strict: yes
19 | comments: yes
20 | inline: yes
21 | text-list-symbols: -o*+
22 | docmapping: yes
23 |
24 | author:
25 | -
26 | ins: M. Mikulėnas
27 | name: Mantas Mikulėnas
28 | organization: Independent
29 | email: grawity@gmail.com
30 | -
31 | ins: D. Oakley
32 | name: Daniel Oakley
33 | organization: ircdocs
34 | role: editor
35 | email: daniel@danieloaks.net
36 |
37 | --- abstract
38 |
39 | This document describes the Client-to-Client Protocol (CTCP), which lets Internet Relay Chat (IRC) clients send each other messages that get displayed or responded to in special ways. CTCP has been widely implemented, with most clients supporting it natively. This document outlines how to implement CTCP and the most common messages.
40 |
41 | This document updates RFCs 1459 and 2812.
42 |
43 | --- middle
44 |
45 | # Introduction
46 |
47 | The core Internet Relay Chat (IRC) protocol as described in {{!RFC1459}} and {{!RFC2812}} does not provide a way to exchange computer-readable information directly between clients. The Client-to-Client Protocol (CTCP) lets them exchange messages that get processed, displayed or responded to in special ways.
48 |
49 | CTCP can be used to request special formatting on messages, query other clients for metadata, and help initiate file transfers with other clients among other uses. This document covers the subset of CTCP which is commonly implemented, and clients implementing this specification are compatible with those implementing the protocol as described by older documents.
50 |
51 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in {{!RFC2119}}.
52 |
53 |
54 | # Protocol Structure
55 |
56 | CTCP queries are sent with the PRIVMSG IRC command, and CTCP replies are sent with NOTICE command. To indicate a CTCP query or reply, the body of the message (the second parameter) begins with the CTCP delimiter.
57 |
58 | Queries MAY be sent to channels. Replies MUST always be sent to the querying client only, not the channel.
59 |
60 | Many servers implement filters so that only specific CTCP commands can be sent to channels. When this is done, channel operators can typically enable and disable this filtering with a channel mode.
61 |
62 |
63 | # Message Syntax
64 |
65 | The ABNF {{!RFC5234}} for CTCP message bodies is as follows:
66 |
67 | ~~~abnf
68 | delim = %x01
69 |
70 | command = 1*( %x02-09 / %x0B-0C / %x0E-1F / %x21-FF )
71 | ; any octet except NUL, delim, CR, LF, and SP
72 |
73 | params = 1*( %x02-09 / %x0B-0C / %x0E-FF )
74 | ; any octet except NUL, delim, CR, and LF
75 |
76 | body = delim command [ SP params ] [ delim ]
77 | ~~~
78 | {: artwork-align="center" artwork-name="syntax"}
79 |
80 | Commands are case-insensitive. When creating new CTCP commands, authors SHOULD use only alphanumeric characters for ease of implementation.
81 |
82 | The final CTCP delimiter SHOULD be sent on outgoing messages for compatibility reasons, but software MUST accept incoming messages which lack it.
83 |
84 | In message examples throughout this document, the CTCP delimiter is shown as `\x01`.
85 |
86 | Here are two examples of valid CTCP queries and replies:
87 |
88 | ~~~
89 | :alice!a@localhost PRIVMSG bob :\x01VERSION\x01
90 | :bob!b@localhost NOTICE alice :\x01VERSION Snak for Mac 4.13\x01
91 |
92 | :alice!a@localhost PRIVMSG #ircv3 :\x01PING 1473523796 918320
93 | :bob!b@localhost NOTICE alice :\x01PING 1473523796 918320\x01
94 | ~~~
95 |
96 |
97 | # Messages
98 |
99 | There is not a formal registry of CTCP message names, and CTCP responses are uniquely flexible. Clients that receive either unexpected messages or known messages with unexpected values SHOULD ignore them and send no response to the querying user.
100 |
101 |
102 | # Acknowledgements
103 |
104 | Thanks to the IRCv3 group for giving feedback on this specification, and to Khaled Mardam-Bey for advice on client flood protection.
105 |
106 | Thanks to Michael Sandrof for creating CTCP, Troy Rollo for creating the related DCC protocol, as well as Klaus Zeuge and Ben Mesander who wrote and revised related specifications.
107 |
108 | Special thanks to dequis, Sadie Powell and James Wheare for help with this and related work.
109 |
110 |
111 | # Security Considerations
112 |
113 | CTCP messages are completely untrusted data and clients MUST NOT assume that they are well-formed or complete.
114 |
115 | Older CTCP specifications describe quoting methods which are complex and not widely implemented. Implementations SHOULD NOT implement "low-level quoting" or "CTCP-level quoting" when parsing messages.
116 |
117 | CTCP requests can be abused to flood clients off the server they are connected to. Clients SHOULD ignore or delay excessive incoming requests to protect against this.
118 |
119 | Older CTCP specifications describe including more than one CTCP message inside a single PRIVMSG or NOTICE command. Implementations SHOULD NOT implement this form of CTCP parsing as it is not widely-implemented and may result in an implementation that can be more easily flooded off the server they are connected to.
120 |
121 |
122 | # IANA Considerations
123 |
124 | This document has no actions for IANA.
125 |
126 |
127 | --- back
128 |
129 |
130 | # Message List
131 |
132 | This section is not exhaustive, and only lists those CTCP messages which are widely implemented across the IRC ecosystem. Clients MUST ONLY send params on a query if a params section is listed here.
133 |
134 | The Query and Reply lines below represent variables by surrounding them with angle brackets.
135 |
136 |
137 | ## ACTION
138 |
139 | ~~~
140 | Query: ACTION
141 | Reply: None
142 | ~~~
143 |
144 | Clients which implement this message MUST display \ as a third-person action or emote. Users typically use the `/me` command in their IRC clients to send this message.
145 |
146 | If \ is empty, clients SHOULD still include a single space after `ACTION` (i.e. an empty params section) to help ensure compatibility. Clients SHOULD correctly parse incoming ACTION messages with or without the params section. Leading spaces in \ SHOULD NOT be stripped before being displayed to users.
147 |
148 | ACTION is universally implemented and very commonly used. Clients MUST implement this CTCP message to effectively use IRC.
149 |
150 | Examples:
151 |
152 | ~~~
153 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION does it!\x01
154 |
155 | Formatted: * dan does it!
156 | ~~~
157 |
158 | ~~~
159 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION \x01
160 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION\x01
161 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION
162 |
163 | Formatted: * dan
164 | ~~~
165 |
166 |
167 | ## CLIENTINFO
168 |
169 | ~~~
170 | Query: CLIENTINFO
171 | Reply: CLIENTINFO
172 | ~~~
173 |
174 | Clients which implement this message MUST reply with a list of the CTCP messages they support, delimited by an ASCII space. Some legacy implementations add an extra text message at the end prefixed by a colon, as demonstrated in the examples.
175 |
176 | CLIENTINFO is widely implemented. Clients SHOULD implement this CTCP message.
177 |
178 | Example:
179 |
180 | ~~~
181 | Query: CLIENTINFO
182 | Reply: CLIENTINFO ACTION DCC CLIENTINFO PING TIME VERSION
183 | ~~~
184 |
185 | ~~~
186 | Query: CLIENTINFO
187 | Reply: CLIENTINFO CLIENTINFO PING VERSION :Use CLIENTINFO
188 | to get more specific information
189 | ~~~
190 |
191 |
192 | ## DCC
193 |
194 | ~~~
195 | Query: DCC
196 | Reply: Described elsewhere.
197 | ~~~
198 |
199 | This message sets up connections that go directly between clients, bypassing the IRC server. This is typically used for features that require a large amount of traffic (e.g. file transfers), or simply direct chat that bypasses the server.
200 |
201 | The Direct Client-to-Client (DCC) protocol requires its own specification, and is not described in-depth here.
202 |
203 | DCC is widely implemented. Clients MAY implement this CTCP message.
204 |
205 |
206 | ## FINGER
207 |
208 | ~~~
209 | Query: FINGER
210 | Reply: FINGER
211 | ~~~
212 |
213 | Clients which implement this message MUST reply with miscellaneous information about the user (typically the contents of their realname/gecos field). However, some implementations return the client name and version instead.
214 |
215 | FINGER is largely obsolete. Clients MAY implement this CTCP message.
216 |
217 | Example:
218 |
219 | ~~~
220 | Query: FINGER
221 | Reply: FINGER WeeChat 1.8-dev
222 | ~~~
223 |
224 |
225 | ## PING
226 |
227 | ~~~
228 | Query: PING
229 | Reply: PING
230 | ~~~
231 |
232 | Clients which implement this message MUST send a reply containing exactly the same params as the original query. However, leading spaces MAY be stripped. This message confirms reachability and latency between two clients.
233 |
234 | PING is universally implemented. Clients SHOULD implement this CTCP message.
235 |
236 | Example:
237 |
238 | ~~~
239 | Query: PING 1473523721 662865
240 | Reply: PING 1473523721 662865
241 |
242 | Query: PING foo bar baz
243 | Reply: PING foo bar baz
244 | ~~~
245 |
246 |
247 | ## SOURCE
248 |
249 | ~~~
250 | Query: SOURCE
251 | Reply: SOURCE
252 | ~~~
253 |
254 | Clients which implement this message MUST reply with a URL where the source code for the client can be found.
255 |
256 | SOURCE is rarely implemented. Clients MAY implement this CTCP message.
257 |
258 | Example:
259 |
260 | ~~~
261 | Query: SOURCE
262 | Reply: SOURCE https://weechat.org/download
263 | ~~~
264 |
265 |
266 | ## TIME
267 |
268 | ~~~
269 | Query: TIME
270 | Reply: TIME
271 | ~~~
272 |
273 | Clients which implement this message MUST reply with the client's local time in a human-readable format. In practice, both the format returned by ctime() and the format described in Section 3.3 of {{!RFC5322}} are common. Earlier specifications recommended prefixing the time string with a colon, but this is no longer recommended.
274 |
275 | Clients MAY default to UTC time for privacy reasons and only respond with the local time if the user enables it.
276 |
277 | TIME is almost universally implemented. Clients MAY implement this CTCP message.
278 |
279 | Example:
280 |
281 | ~~~
282 | Query: TIME
283 | Reply: TIME Mon, 08 May 2017 09:15:29 GMT
284 | ~~~
285 |
286 |
287 | ## VERSION
288 |
289 | ~~~
290 | Query: VERSION
291 | Reply: VERSION
292 | ~~~
293 |
294 | Clients which implement this message MUST reply with the name and version of the client software in use. There is no specified format for the version string.
295 |
296 | Clients MAY receive more than one reply after sending a VERSION query. Clients may allow users to customise the response value for this query.
297 |
298 | VERSION is universally implemented. Clients SHOULD implement this CTCP message.
299 |
300 | Example:
301 |
302 | ~~~
303 | Query: VERSION
304 | Reply: VERSION WeeChat 1.8-dev (git: v1.7-329-g22f2fd03a)
305 | ~~~
306 |
307 |
308 | ## USERINFO
309 |
310 | ~~~
311 | Query: USERINFO
312 | Reply: USERINFO
313 | ~~~
314 |
315 | Clients which implement this message MUST reply with miscellaneous information about the user (typically the contents of their realname/gecos field).
316 |
317 | USERINFO is largely obsolete. Clients MAY implement this CTCP message.
318 |
319 | Example:
320 |
321 | ~~~
322 | Query: USERINFO
323 | Reply: USERINFO fred (Fred Foobar)
324 | ~~~
325 |
326 | # Change History \[RFC Editor: Please remove this section\]
327 |
328 | Changes from draft 2 (... 2021)
329 |
330 | - Removed the CTCP Types section (thanks James).
331 | - Added advice on leading spaces in messages (thanks Sadie).
332 | - Minor ABNF fix.
333 |
334 | Changes from draft 1 (July 18, 2017)
335 |
336 | - General editing, fixed mistypes.
337 | - Simplified some of the examples.
338 |
339 | Changes from draft 0 (May 29, 2017)
340 |
341 | - Added note about servers truncating CTCP messages (thanks Sadie).
342 | - Fixed misspellings and added note to TIME about previously-recommended prefix (thanks Patrick).
343 | - Mentioned how to parse/send empty ACTION messages (thanks dequis and the crew).
344 |
--------------------------------------------------------------------------------
/versions/ctcp/draft-oakley-irc-ctcp-00.mkd:
--------------------------------------------------------------------------------
1 | ---
2 | coding: utf-8
3 |
4 | title: "Internet Relay Chat: Client-to-Client Protocol (CTCP)"
5 | abbrev: IRC Client-to-Client Protocol
6 | docname: draft-oakley-irc-ctcp-00
7 |
8 | submissionType: independent
9 | category: info
10 |
11 | stand_alone: yes
12 | pi: [toc, sortrefs, symrefs, comments]
13 |
14 | updates: 1459, 2812
15 |
16 | author:
17 | -
18 | #ins: M. Mikulėnas
19 | #name: Mantas Mikulėnas
20 | ins: M. Mikulenas
21 | name: Mantas Mikulenas
22 | org: Independent
23 | email: grawity@gmail.com
24 | -
25 | ins: D. Oakley
26 | name: Daniel Oakley
27 | org: ircdocs
28 | email: daniel@danieloaks.net
29 |
30 | --- abstract
31 |
32 | This document describes the Client-to-Client Protocol (CTCP), which lets Internet Relay Chat (IRC) clients send each other messages that get displayed or responded to in special ways. CTCP has been widely implemented, with most clients supporting it natively. This document outlines how to implement CTCP and the most common messages used.
33 |
34 | It updates RFC 1459 and RFC 2812.
35 |
36 | --- middle
37 |
38 | # Introduction
39 |
40 | The core Internet Relay Chat (IRC) protocol as described in {{!RFC1459}} and {{!RFC2812}} only has a single command for regular user messages, and does not provide a way for clients to exchange information directly. Client-to-Client Protocol (CTCP) messages let clients exchange messages that get displayed or responded to in special ways. Some examples of how CTCP is used is to request special formatting on messages, query other clients for metadata, and help initiate file transfers with other clients.
41 |
42 | This document goes over the subset of CTCP which is commonly implemented, and is compatible with clients implementing CTCP as described by older documents.
43 |
44 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in {{!RFC2119}}.
45 |
46 |
47 | # Message Syntax
48 |
49 | CTCP queries are sent with the PRIVMSG IRC command, and CTCP replies are sent with NOTICE command. To indicate a CTCP query or reply, the body of the message (the second parameter) begins with the CTCP delimiter. The ABNF {{!RFC5234}} for this message body is as follows:
50 |
51 | ~~~abnf
52 | delim = %x01
53 |
54 | command = 1*( %x02-09 / %x0B-0C / %x0E-1F / %x21-FF )
55 | ; any octet except NUL, delim, CR, LF, and " "
56 |
57 | params = 1*( %x02-09 / %x0B-0C / %x0E-FF )
58 | ; any octet except NUL, delim, CR, and LF
59 |
60 | body = delim command [ SPACE params ] [ delim ]
61 | ~~~
62 | {: artwork-align="center" artwork-name="syntax"}
63 |
64 | Commands are case-insensitive. When creating new CTCP commands, authors SHOULD use only alphanumeric characters for ease of implementation.
65 |
66 | The final CTCP delimiter SHOULD be sent on outgoing messages for compatibility reasons, and software MUST accept incoming messages which lack it. This is due to how certain clients implement message splitting and truncation.
67 |
68 | Queries MAY be sent to channels. When these queries are responded to, the responses are sent to the querying client rather than the channel which the query was originally sent to.
69 |
70 | Many servers implement optional filtering so that only the ACTION CTCP message can be sent to channels. When this is done, it can typically be enabled or disabled by channel operators with a channel mode.
71 |
72 | Here are two examples of CTCP queries and replies:
73 |
74 | ~~~
75 | :alice PRIVMSG bob :\x01VERSION\x01
76 | :bob NOTICE alice :\x01VERSION Snak for Macintosh 4.13 English\x01
77 |
78 | :alice PRIVMSG #ircv3 :\x01PING 1473523796 918320\x01
79 | :bob NOTICE alice :\x01PING 1473523796 918320\x01
80 | ~~~
81 |
82 |
83 | # Message Types
84 |
85 | CTCP messages generally take on one of these types. These message types are defined here to simplify understanding, and aren’t differentiated by the protocol itself.
86 |
87 |
88 | ## Extended formatting
89 |
90 | This type of CTCP is used to request special formatting of a user-visible message. That is, to send a user-visible message that should be displayed differently from regular messages - e.g. as an action, a whisper, an announcement.
91 |
92 | Extended formatting messages are sent as a PRIVMSG, and are expected to be used in channels as well as between clients. There is no automatic response to this message type, as it is not a query nor reply.
93 |
94 | These messages are sent as a PRIVMSG and can have parameters, but generate no reply.
95 |
96 | Example:
97 |
98 | ~~~
99 | :dan PRIVMSG #ircv3 :\x01ACTION writes some specs!\x01
100 | ~~~
101 |
102 |
103 | ## Metadata Query
104 |
105 | This type of CTCP is used to provide relatively static information about the target client, user or connection.
106 |
107 | This CTCP takes the form of a query and a response (as a PRIVMSG and NOTICE, respectively). Due to how bouncers interact with multiple clients, there may sometimes be multiple responses to queries.
108 |
109 | Metadata queries MUST NOT require the recipient to implement any side effects (beyond sending the reply itself); if a CTCP message causes side effects by design, it should be categorized as an extended query instead.
110 |
111 | Metadata queries do not have any parameters, but expect a reply with parameters as the response data.
112 |
113 | Example:
114 |
115 | ~~~
116 | :alice PRIVMSG bob :\x01VERSION\x01
117 | :bob NOTICE alice :\x01VERSION SaberChat 27.5\x01
118 | ~~~
119 |
120 |
121 | ## Extended Query
122 |
123 | This type of CTCP is used to provide dynamic information or invoke actions from the client.
124 |
125 | This CTCP takes the form of a query and a response (as a PRIVMSG and NOTICE, respectively).
126 |
127 | Queries sent to a channel always generate private replies.
128 |
129 | Extended queries and replies may have parameters.
130 |
131 | Example:
132 |
133 | ~~~
134 | :alice PRIVMSG bob :\x01PING 1473523796 918320\x01
135 | :bob NOTICE alice :\x01PING 1473523796 918320\x01
136 | ~~~
137 |
138 |
139 | # Messages
140 |
141 | CTCP messages themselves are not standardised. Clients that receive either unexpected messages or known messages with unexpected values SHOULD ignore them and produce no response to the sending user. Clients MAY receive more than one response per user for a query they send, due to multiple clients being connected behind an IRC bouncer.
142 |
143 |
144 | # Acknowledgements
145 |
146 | Thanks to the IRCv3 group for giving feedback on this specification, and to Khaled for advice on client flood protection.
147 |
148 | Thanks to Michael Sandrof for creating CTCP, Troy Rollo for creating the related DCC protocol, as well as Klaus Zeuge and Ben Mesander who wrote and revised related specifications.
149 |
150 | Special thanks to dequis, Peter Powell and James Wheare for help with this and related work.
151 |
152 |
153 | # Security Considerations
154 |
155 | CTCP messages are completely untrusted data, and clients MUST NOT assume that they are well-formed or complete.
156 |
157 | Older CTCP specifications describe quoting methods which are complex and not widely implemented. Implementations SHOULD NOT implement "low-level quoting" or "CTCP-level quoting" when parsing messages.
158 |
159 | Older CTCP specifications describe including more than one CTCP message inside a single PRIVMSG or NOTICE command. Implementations SHOULD NOT implement this form of CTCP parsing as it is not widely-implemented and may result in an implementation that can be more easily flooded off the server they are connected to.
160 |
161 | CTCP requests can be abused to flood clients off the server they are connected to. Clients may ignore or delay excessive incoming requests to protect against this.
162 |
163 |
164 | # IANA Considerations
165 |
166 | This document has no actions for IANA.
167 |
168 |
169 | --- back
170 |
171 |
172 | # Message List
173 |
174 | This section is not exhaustive, and only lists those CTCP messages which are widely implemented across the IRC ecosystem.
175 |
176 | The reply and parameter lines below use a simplified syntax that represents variables by surrounding them with angle brackets,.
177 |
178 |
179 | ## ACTION
180 |
181 | ~~~
182 | Type: Extended Formatting
183 | Params: ACTION
184 | ~~~
185 |
186 | This extended formatting message shows that \ should be displayed as a third-person action or emote; in clients, it’s generally activated with the command `/me`.
187 |
188 | ACTION is universally implemented and very commonly used. Clients MUST implement this CTCP message to effectively use IRC.
189 |
190 | Example:
191 |
192 | ~~~
193 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION does it!\x01
194 |
195 | Formatted: * dan does it!
196 | ~~~
197 |
198 |
199 | ## CLIENTINFO
200 |
201 | ~~~
202 | Type: Extended Query
203 | Reply: CLIENTINFO
204 | ~~~
205 |
206 | This extended query returns a list of the CTCP messages that this client supports and implements, delimited by a single ASCII space.
207 |
208 | CLIENTINFO is widely implemented. Clients SHOULD implement this CTCP message.
209 |
210 | Example:
211 |
212 | ~~~
213 | Query: CLIENTINFO
214 | Response: CLIENTINFO ACTION DCC CLIENTINFO PING TIME VERSION
215 | ~~~
216 |
217 |
218 | ## DCC
219 |
220 | ~~~
221 | Type: Extended Query
222 | Params: DCC
223 | ~~~
224 |
225 | This extended query is used to setup and control connections that go directly between clients, bypassing the IRC server. This is typically used for features that require a large amount of traffic between clients or simply wish to bypass the server itself such as file transfer and direct chat.
226 |
227 | The Direct Client-to-Client (DCC) Protocol requires its own specification, and is not described in-depth here.
228 |
229 | DCC is widely implemented. Clients MAY implement this CTCP message.
230 |
231 |
232 | ## FINGER
233 |
234 | ~~~
235 | Type: Metadata Query
236 | Reply: FINGER
237 | ~~~
238 |
239 | This metadata query returns miscellaneous info about the user, typically the same information that’s held in their realname field.
240 |
241 | However, some implementations return the client name and version instead.
242 |
243 | FINGER is largely obsolete. Clients MAY implement this CTCP message.
244 |
245 | Example:
246 |
247 | ~~~
248 | Query: FINGER
249 | Response: FINGER WeeChat 1.8-dev
250 | ~~~
251 |
252 |
253 | ## PING
254 |
255 | ~~~
256 | Type: Extended Query
257 | Params: PING
258 | ~~~
259 |
260 | This extended query is used to confirm reachability with other clients and to check latency. When receiving a CTCP PING, the reply MUST contain exactly the same parameters as the original query.
261 |
262 | PING is universally implemented. Clients SHOULD implement this CTCP message.
263 |
264 | Example:
265 |
266 | ~~~
267 | Query: PING 1473523721 662865
268 | Response: PING 1473523721 662865
269 |
270 | Query: PING foo bar baz
271 | Response: PING foo bar baz
272 | ~~~
273 |
274 |
275 | ## SOURCE
276 |
277 | ~~~
278 | Type: Metadata Query
279 | Reply: SOURCE
280 | ~~~
281 |
282 | This metadata query is used to return the location of the source code for the client.
283 |
284 | SOURCE is rarely implemented. Clients MAY implement this CTCP message.
285 |
286 | Example:
287 |
288 | ~~~
289 | Query: SOURCE
290 | Response: SOURCE https://weechat.org/download
291 | ~~~
292 |
293 |
294 | ## TIME
295 |
296 | ~~~
297 | Type: Extended Query
298 | Params: TIME
299 | ~~~
300 |
301 | This extended query is used to return the client’s local time in an unspecified human-readable format. In practice, both the format output by ctime() and the format described in Section 3.3 of {{!RFC5322}} are common.
302 |
303 | New implementations MAY default to UTC time for privacy reasons.
304 |
305 | TIME is almost universally implemented. Clients SHOULD implement this CTCP message.
306 |
307 | Example:
308 |
309 | ~~~
310 | Query: TIME
311 | Response: TIME Mon, 08 May 2017 09:15:29 GMT
312 | ~~~
313 |
314 |
315 | ## VERSION
316 |
317 | ~~~
318 | Type: Metadata Query
319 | Reply: VERSION
320 | ~~~
321 |
322 | This metadata query is used to return the name and version of the client software in use. There is no specified format for the version string.
323 |
324 | Clients may allow users to customise the response value for this query.
325 |
326 | VERSION is universally implemented. Clients SHOULD implement this CTCP message.
327 |
328 | Example:
329 |
330 | ~~~
331 | Query: VERSION
332 | Response: VERSION WeeChat 1.8-dev (git: v1.7-329-g22f2fd03a)
333 | ~~~
334 |
335 |
336 | ## USERINFO
337 |
338 | ~~~
339 | Type: Metadata Query
340 | Reply: USERINFO
341 | ~~~
342 |
343 | This metadata query returns miscellaneous info about the user, typically the same information that’s held in their realname field.
344 |
345 | However, some implementations return ` ()` instead.
346 |
347 | USERINFO is largely obsolete. Clients MAY implement this CTCP message.
348 |
349 | Example:
350 |
351 | ~~~
352 | Query: USERINFO
353 | Response: USERINFO fred (Fred Foobar)
354 | ~~~
355 |
--------------------------------------------------------------------------------
/versions/ctcp/draft-oakley-irc-ctcp-01.mkd:
--------------------------------------------------------------------------------
1 | ---
2 | coding: utf-8
3 |
4 | title: "Internet Relay Chat: Client-to-Client Protocol (CTCP)"
5 | abbrev: IRC Client-to-Client Protocol
6 | docname: draft-oakley-irc-ctcp-01
7 |
8 | submissionType: independent
9 | category: info
10 |
11 | stand_alone: yes
12 | pi: [toc, sortrefs, symrefs, comments]
13 |
14 | updates: 1459, 2812
15 |
16 | author:
17 | -
18 | #ins: M. Mikulėnas
19 | #name: Mantas Mikulėnas
20 | ins: M. Mikulenas
21 | name: Mantas Mikulenas
22 | org: Independent
23 | email: grawity@gmail.com
24 | -
25 | ins: D. Oakley
26 | name: Daniel Oakley
27 | org: ircdocs
28 | email: daniel@danieloaks.net
29 |
30 | --- abstract
31 |
32 | This document describes the Client-to-Client Protocol (CTCP), which lets Internet Relay Chat (IRC) clients send each other messages that get displayed or responded to in special ways. CTCP has been widely implemented, with most clients supporting it natively. This document outlines how to implement CTCP and the most common messages used.
33 |
34 | It updates RFC 1459 and RFC 2812.
35 |
36 | --- middle
37 |
38 | # Introduction
39 |
40 | The core Internet Relay Chat (IRC) protocol as described in {{!RFC1459}} and {{!RFC2812}} only has a single command for regular user messages, and does not provide a way for clients to exchange information directly. Client-to-Client Protocol (CTCP) messages let clients exchange messages that get displayed or responded to in special ways. Some examples of how CTCP is used is to request special formatting on messages, query other clients for metadata, and help initiate file transfers with other clients.
41 |
42 | This document goes over the subset of CTCP which is commonly implemented, and is compatible with clients implementing CTCP as described by older documents.
43 |
44 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in {{!RFC2119}}.
45 |
46 |
47 | # Message Syntax
48 |
49 | CTCP queries are sent with the PRIVMSG IRC command, and CTCP replies are sent with NOTICE command. To indicate a CTCP query or reply, the body of the message (the second parameter) begins with the CTCP delimiter. The ABNF {{!RFC5234}} for this message body is as follows:
50 |
51 | ~~~abnf
52 | delim = %x01
53 |
54 | command = 1*( %x02-09 / %x0B-0C / %x0E-1F / %x21-FF )
55 | ; any octet except NUL, delim, CR, LF, and " "
56 |
57 | params = 1*( %x02-09 / %x0B-0C / %x0E-FF )
58 | ; any octet except NUL, delim, CR, and LF
59 |
60 | body = delim command [ SPACE params ] [ delim ]
61 | ~~~
62 | {: artwork-align="center" artwork-name="syntax"}
63 |
64 | Commands are case-insensitive. When creating new CTCP commands, authors SHOULD use only alphanumeric characters for ease of implementation.
65 |
66 | The final CTCP delimiter SHOULD be sent on outgoing messages for compatibility reasons, and software MUST accept incoming messages which lack it. This is due to how servers implement message truncation and certain clients implement message splitting.
67 |
68 | Queries MAY be sent to channels. When these queries are responded to, the responses are sent to the querying client rather than the channel which the query was originally sent to.
69 |
70 | Many servers implement optional filtering so that only the ACTION CTCP message can be sent to channels. When this is done, it can typically be enabled or disabled by channel operators with a channel mode.
71 |
72 | Here are two examples of CTCP queries and replies:
73 |
74 | ~~~
75 | :alice!a@localhost PRIVMSG bob :\x01VERSION\x01
76 | :bob!b@localhost NOTICE alice :\x01VERSION Snak for Mac 4.13\x01
77 |
78 | :alice!a@localhost PRIVMSG #ircv3 :\x01PING 1473523796 918320\x01
79 | :bob!b@localhost NOTICE alice :\x01PING 1473523796 918320\x01
80 | ~~~
81 |
82 |
83 | # Message Types
84 |
85 | CTCP messages generally take on one of these types. These message types are defined here to simplify understanding, and aren’t differentiated by the protocol itself.
86 |
87 |
88 | ## Extended formatting
89 |
90 | This type of CTCP is used to request special formatting of a user-visible message. That is, to send a user-visible message that should be displayed differently from regular messages - e.g. as an action, a whisper, an announcement.
91 |
92 | Extended formatting messages are sent as a PRIVMSG, and are expected to be used in channels as well as between clients. There is no automatic response to this message type, as it is not a query nor reply.
93 |
94 | These messages are sent as a PRIVMSG and can have parameters, but generate no reply.
95 |
96 | Example:
97 |
98 | ~~~
99 | :dan!u@localhost PRIVMSG #ircv3 :\x01ACTION writes some specs!\x01
100 | ~~~
101 |
102 |
103 | ## Metadata Query
104 |
105 | This type of CTCP is used to provide relatively static information about the target client, user or connection.
106 |
107 | This CTCP takes the form of a query and a response (as a PRIVMSG and NOTICE, respectively). Due to how bouncers interact with multiple clients, there may sometimes be multiple responses to queries.
108 |
109 | Metadata queries MUST NOT require the recipient to implement any side effects (beyond sending the reply itself); if a CTCP message causes side effects by design, it should be categorized as an extended query instead.
110 |
111 | Metadata queries do not have any parameters, but expect a reply with parameters as the response data.
112 |
113 | Example:
114 |
115 | ~~~
116 | :alice!a@localhost PRIVMSG bob :\x01VERSION\x01
117 | :bob!b@localhost NOTICE alice :\x01VERSION SaberChat 27.5\x01
118 | ~~~
119 |
120 |
121 | ## Extended Query
122 |
123 | This type of CTCP is used to provide dynamic information or invoke actions from the client.
124 |
125 | This CTCP takes the form of a query and a response (as a PRIVMSG and NOTICE, respectively).
126 |
127 | Queries sent to a channel always generate private replies.
128 |
129 | Extended queries and replies may have parameters.
130 |
131 | Example:
132 |
133 | ~~~
134 | :alice!a@localhost PRIVMSG bob :\x01PING 1473523796 918320\x01
135 | :bob!b@localhost NOTICE alice :\x01PING 1473523796 918320\x01
136 | ~~~
137 |
138 |
139 | # Messages
140 |
141 | CTCP messages themselves are not standardised. Clients that receive either unexpected messages or known messages with unexpected values SHOULD ignore them and produce no response to the sending user. Clients MAY receive more than one response per user for a query they send, due to multiple clients being connected behind an IRC bouncer.
142 |
143 |
144 | # Acknowledgements
145 |
146 | Thanks to the IRCv3 group for giving feedback on this specification, and to Khaled for advice on client flood protection.
147 |
148 | Thanks to Michael Sandrof for creating CTCP, Troy Rollo for creating the related DCC protocol, as well as Klaus Zeuge and Ben Mesander who wrote and revised related specifications.
149 |
150 | Special thanks to dequis, Peter Powell and James Wheare for help with this and related work.
151 |
152 |
153 | # Security Considerations
154 |
155 | CTCP messages are completely untrusted data, and clients MUST NOT assume that they are well-formed or complete.
156 |
157 | Older CTCP specifications describe quoting methods which are complex and not widely implemented. Implementations SHOULD NOT implement "low-level quoting" or "CTCP-level quoting" when parsing messages.
158 |
159 | Older CTCP specifications describe including more than one CTCP message inside a single PRIVMSG or NOTICE command. Implementations SHOULD NOT implement this form of CTCP parsing as it is not widely-implemented and may result in an implementation that can be more easily flooded off the server they are connected to.
160 |
161 | CTCP requests can be abused to flood clients off the server they are connected to. Clients may ignore or delay excessive incoming requests to protect against this.
162 |
163 |
164 | # IANA Considerations
165 |
166 | This document has no actions for IANA.
167 |
168 |
169 | --- back
170 |
171 |
172 | # Message List
173 |
174 | This section is not exhaustive, and only lists those CTCP messages which are widely implemented across the IRC ecosystem.
175 |
176 | The reply and parameter lines below use a simplified syntax that represents variables by surrounding them with angle brackets.
177 |
178 |
179 | ## ACTION
180 |
181 | ~~~
182 | Type: Extended Formatting
183 | Params: ACTION
184 | ~~~
185 |
186 | This extended formatting message shows that \ should be displayed as a third-person action or emote; in clients, it’s generally activated with the command `/me`.
187 |
188 | If \ is empty, clients SHOULD still include a single space after `ACTION` (i.e. an empty params section) to help compatibility. Clients SHOULD correctly parse incoming ACTION messages with or without the params section.
189 |
190 | ACTION is universally implemented and very commonly used. Clients MUST implement this CTCP message to effectively use IRC.
191 |
192 | Examples:
193 |
194 | ~~~
195 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION does it!\x01
196 |
197 | Formatted: * dan does it!
198 | ~~~
199 |
200 | ~~~
201 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION \x01
202 |
203 | Formatted: * dan
204 | ~~~
205 |
206 | ~~~
207 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION\x01
208 |
209 | Formatted: * dan
210 | ~~~
211 |
212 |
213 | ## CLIENTINFO
214 |
215 | ~~~
216 | Type: Extended Query
217 | Reply: CLIENTINFO
218 | ~~~
219 |
220 | This extended query returns a list of the CTCP messages that this client supports and implements, delimited by a single ASCII space.
221 |
222 | CLIENTINFO is widely implemented. Clients SHOULD implement this CTCP message.
223 |
224 | Example:
225 |
226 | ~~~
227 | Query: CLIENTINFO
228 | Response: CLIENTINFO ACTION DCC CLIENTINFO PING TIME VERSION
229 | ~~~
230 |
231 |
232 | ## DCC
233 |
234 | ~~~
235 | Type: Extended Query
236 | Params: DCC
237 | ~~~
238 |
239 | This extended query is used to setup and control connections that go directly between clients, bypassing the IRC server. This is typically used for features that require a large amount of traffic between clients or simply wish to bypass the server itself such as file transfer and direct chat.
240 |
241 | The Direct Client-to-Client (DCC) Protocol requires its own specification, and is not described in-depth here.
242 |
243 | DCC is widely implemented. Clients MAY implement this CTCP message.
244 |
245 |
246 | ## FINGER
247 |
248 | ~~~
249 | Type: Metadata Query
250 | Reply: FINGER
251 | ~~~
252 |
253 | This metadata query returns miscellaneous info about the user, typically the same information that’s held in their realname field.
254 |
255 | However, some implementations return the client name and version instead.
256 |
257 | FINGER is largely obsolete. Clients MAY implement this CTCP message.
258 |
259 | Example:
260 |
261 | ~~~
262 | Query: FINGER
263 | Response: FINGER WeeChat 1.8-dev
264 | ~~~
265 |
266 |
267 | ## PING
268 |
269 | ~~~
270 | Type: Extended Query
271 | Params: PING
272 | ~~~
273 |
274 | This extended query is used to confirm reachability with other clients and to check latency. When receiving a CTCP PING, the reply MUST contain exactly the same parameters as the original query.
275 |
276 | PING is universally implemented. Clients SHOULD implement this CTCP message.
277 |
278 | Example:
279 |
280 | ~~~
281 | Query: PING 1473523721 662865
282 | Response: PING 1473523721 662865
283 |
284 | Query: PING foo bar baz
285 | Response: PING foo bar baz
286 | ~~~
287 |
288 |
289 | ## SOURCE
290 |
291 | ~~~
292 | Type: Metadata Query
293 | Reply: SOURCE
294 | ~~~
295 |
296 | This metadata query is used to return the location of the source code for the client.
297 |
298 | SOURCE is rarely implemented. Clients MAY implement this CTCP message.
299 |
300 | Example:
301 |
302 | ~~~
303 | Query: SOURCE
304 | Response: SOURCE https://weechat.org/download
305 | ~~~
306 |
307 |
308 | ## TIME
309 |
310 | ~~~
311 | Type: Extended Query
312 | Params: TIME
313 | ~~~
314 |
315 | This extended query is used to return the client’s local time in an unspecified human-readable format. In practice, both the format output by ctime() and the format described in Section 3.3 of {{!RFC5322}} are common. Earlier specifications recommended to prefix the time string with a colon, but this is no longer recommended.
316 |
317 | New implementations MAY default to UTC time for privacy reasons.
318 |
319 | TIME is almost universally implemented. Clients SHOULD implement this CTCP message.
320 |
321 | Example:
322 |
323 | ~~~
324 | Query: TIME
325 | Response: TIME Mon, 08 May 2017 09:15:29 GMT
326 | ~~~
327 |
328 |
329 | ## VERSION
330 |
331 | ~~~
332 | Type: Metadata Query
333 | Reply: VERSION
334 | ~~~
335 |
336 | This metadata query is used to return the name and version of the client software in use. There is no specified format for the version string.
337 |
338 | Clients may allow users to customise the response value for this query.
339 |
340 | VERSION is universally implemented. Clients SHOULD implement this CTCP message.
341 |
342 | Example:
343 |
344 | ~~~
345 | Query: VERSION
346 | Response: VERSION WeeChat 1.8-dev (git: v1.7-329-g22f2fd03a)
347 | ~~~
348 |
349 |
350 | ## USERINFO
351 |
352 | ~~~
353 | Type: Metadata Query
354 | Reply: USERINFO
355 | ~~~
356 |
357 | This metadata query returns miscellaneous info about the user, typically the same information that’s held in their realname field.
358 |
359 | However, some implementations return ` ()` instead.
360 |
361 | USERINFO is largely obsolete. Clients MAY implement this CTCP message.
362 |
363 | Example:
364 |
365 | ~~~
366 | Query: USERINFO
367 | Response: USERINFO fred (Fred Foobar)
368 | ~~~
369 |
370 | # Change History \[RFC Editor: Please remove this section\]
371 |
372 | Changes from draft 0 (May 29, 2017)
373 |
374 | - Added note about servers truncating CTCP messages (thanks Peter).
375 | - Fixed misspellings and added note to TIME about previously-recommended prefix (thanks Patrick).
376 | - Mentioned how to parse/send empty ACTION messages (thanks dequis and the crew).
377 |
--------------------------------------------------------------------------------
/versions/ctcp/draft-oakley-irc-ctcp-02.mkd:
--------------------------------------------------------------------------------
1 | ---
2 | coding: utf-8
3 |
4 | title: "Internet Relay Chat: Client-to-Client Protocol (CTCP)"
5 | abbrev: IRC Client-to-Client Protocol
6 | docname: draft-oakley-irc-ctcp-02
7 |
8 | submissionType: independent
9 | category: info
10 |
11 | stand_alone: yes
12 | pi: [toc, sortrefs, symrefs, comments]
13 |
14 | updates: 1459, 2812
15 |
16 | author:
17 | -
18 | #ins: M. Mikulėnas
19 | #name: Mantas Mikulėnas
20 | ins: M. Mikulenas
21 | name: Mantas Mikulenas
22 | org: Independent
23 | email: grawity@gmail.com
24 | -
25 | ins: D. Oakley
26 | name: Daniel Oakley
27 | org: ircdocs
28 | email: daniel@danieloaks.net
29 |
30 | --- abstract
31 |
32 | This document describes the Client-to-Client Protocol (CTCP), which lets Internet Relay Chat (IRC) clients send each other messages that get displayed or responded to in special ways. CTCP has been widely implemented, with most clients supporting it natively. This document outlines how to implement CTCP and the most common messages used.
33 |
34 | It updates RFC 1459 and RFC 2812.
35 |
36 | --- middle
37 |
38 | # Introduction
39 |
40 | The core Internet Relay Chat (IRC) protocol as described in {{!RFC1459}} and {{!RFC2812}} only has a single command for regular user messages, and does not provide a way for clients to exchange information directly. Client-to-Client Protocol (CTCP) messages let clients exchange messages that get displayed or responded to in special ways. Some examples of how CTCP is used is to request special formatting on messages, query other clients for metadata, and help initiate file transfers with other clients.
41 |
42 | This document goes over the subset of CTCP which is commonly implemented, and is compatible with clients implementing CTCP as described by older documents.
43 |
44 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in {{!RFC2119}}.
45 |
46 |
47 | # Message Syntax
48 |
49 | CTCP queries are sent with the PRIVMSG IRC command, and CTCP replies are sent with NOTICE command. To indicate a CTCP query or reply, the body of the message (the second parameter) begins with the CTCP delimiter. The ABNF {{!RFC5234}} for this message body is as follows:
50 |
51 | ~~~abnf
52 | delim = %x01
53 |
54 | command = 1*( %x02-09 / %x0B-0C / %x0E-1F / %x21-FF )
55 | ; any octet except NUL, delim, CR, LF, and " "
56 |
57 | params = 1*( %x02-09 / %x0B-0C / %x0E-FF )
58 | ; any octet except NUL, delim, CR, and LF
59 |
60 | body = delim command [ SPACE params ] [ delim ]
61 | ~~~
62 | {: artwork-align="center" artwork-name="syntax"}
63 |
64 | Commands are case-insensitive. When creating new CTCP commands, authors SHOULD use only alphanumeric characters for ease of implementation.
65 |
66 | The final CTCP delimiter SHOULD be sent on outgoing messages for compatibility reasons, and software MUST accept incoming messages which lack it. This is due to how servers implement message truncation and certain clients implement message splitting.
67 |
68 | Queries MAY be sent to channels. When these queries are responded to, the responses are sent to the querying client rather than the channel which the query was originally sent to.
69 |
70 | Many servers implement optional filtering so that only the ACTION CTCP message can be sent to channels. When this is done, it can typically be enabled or disabled by channel operators with a channel mode.
71 |
72 | Here are two examples of CTCP queries and replies:
73 |
74 | ~~~
75 | :alice!a@localhost PRIVMSG bob :\x01VERSION\x01
76 | :bob!b@localhost NOTICE alice :\x01VERSION Snak for Mac 4.13\x01
77 |
78 | :alice!a@localhost PRIVMSG #ircv3 :\x01PING 1473523796 918320\x01
79 | :bob!b@localhost NOTICE alice :\x01PING 1473523796 918320\x01
80 | ~~~
81 |
82 |
83 | # Message Types
84 |
85 | CTCP messages generally take on one of these types. These message types are defined here to simplify understanding, and aren’t differentiated by the protocol itself.
86 |
87 |
88 | ## Extended formatting
89 |
90 | This type of CTCP requests special formatting of a user-visible message. That is, to send a user-visible message that should be displayed differently from regular messages - e.g. as an action, a whisper, an announcement.
91 |
92 | Extended formatting messages are sent as a PRIVMSG, and are expected to be used in channels as well as between clients. There is no automatic response to this message type, as it is not a query nor reply.
93 |
94 | These messages are sent as a PRIVMSG and can have parameters, but generate no reply.
95 |
96 | Example:
97 |
98 | ~~~
99 | :dan!u@localhost PRIVMSG #ircv3 :\x01ACTION writes some specs!\x01
100 | ~~~
101 |
102 |
103 | ## Metadata Query
104 |
105 | This type of CTCP provides relatively static information about the target client, user or connection.
106 |
107 | This CTCP takes the form of a query and a response (as a PRIVMSG and NOTICE, respectively). Due to how bouncers interact with multiple clients, there may sometimes be multiple responses to queries.
108 |
109 | Metadata queries MUST NOT require the recipient to implement any side effects (beyond sending the reply itself); if a CTCP message causes side effects by design, it should be categorized as an extended query instead.
110 |
111 | Metadata queries do not have any parameters, but expect a reply with parameters as the response data.
112 |
113 | Example:
114 |
115 | ~~~
116 | :alice!a@localhost PRIVMSG bob :\x01VERSION\x01
117 | :bob!b@localhost NOTICE alice :\x01VERSION SaberChat 27.5\x01
118 | ~~~
119 |
120 |
121 | ## Extended Query
122 |
123 | This type of CTCP provides dynamic information or invoke actions from the client.
124 |
125 | This CTCP takes the form of a query and a response (as a PRIVMSG and NOTICE, respectively).
126 |
127 | Queries sent to a channel always generate private replies.
128 |
129 | Extended queries and replies may have parameters.
130 |
131 | Example:
132 |
133 | ~~~
134 | :alice!a@localhost PRIVMSG bob :\x01PING 1473523796 918320\x01
135 | :bob!b@localhost NOTICE alice :\x01PING 1473523796 918320\x01
136 | ~~~
137 |
138 |
139 | # Messages
140 |
141 | CTCP messages themselves are not standardised. Clients that receive either unexpected messages or known messages with unexpected values SHOULD ignore them and produce no response to the sending user. Clients MAY receive more than one response per user for a query they send, due to multiple clients being connected behind an IRC bouncer.
142 |
143 |
144 | # Acknowledgements
145 |
146 | Thanks to the IRCv3 group for giving feedback on this specification, and to Khaled for advice on client flood protection.
147 |
148 | Thanks to Michael Sandrof for creating CTCP, Troy Rollo for creating the related DCC protocol, as well as Klaus Zeuge and Ben Mesander who wrote and revised related specifications.
149 |
150 | Special thanks to dequis, Sadie and James Wheare for help with this and related work.
151 |
152 |
153 | # Security Considerations
154 |
155 | CTCP messages are completely untrusted data, and clients MUST NOT assume that they are well-formed or complete.
156 |
157 | Older CTCP specifications describe quoting methods which are complex and not widely implemented. Implementations SHOULD NOT implement "low-level quoting" or "CTCP-level quoting" when parsing messages.
158 |
159 | Older CTCP specifications describe including more than one CTCP message inside a single PRIVMSG or NOTICE command. Implementations SHOULD NOT implement this form of CTCP parsing as it is not widely-implemented and may result in an implementation that can be more easily flooded off the server they are connected to.
160 |
161 | CTCP requests can be abused to flood clients off the server they are connected to. Clients may ignore or delay excessive incoming requests to protect against this.
162 |
163 |
164 | # IANA Considerations
165 |
166 | This document has no actions for IANA.
167 |
168 |
169 | --- back
170 |
171 |
172 | # Message List
173 |
174 | This section is not exhaustive, and only lists those CTCP messages which are widely implemented across the IRC ecosystem.
175 |
176 | The reply and parameter lines below use a simplified syntax that represents variables by surrounding them with angle brackets.
177 |
178 |
179 | ## ACTION
180 |
181 | ~~~
182 | Type: Extended Formatting
183 | Params: ACTION
184 | ~~~
185 |
186 | This extended formatting message shows that \ should be displayed as a third-person action or emote; in clients, it’s generally activated with the command `/me`.
187 |
188 | If \ is empty, clients SHOULD still include a single space after `ACTION` (i.e. an empty params section) to help compatibility. Clients SHOULD correctly parse incoming ACTION messages with or without the params section.
189 |
190 | ACTION is universally implemented and very commonly used. Clients MUST implement this CTCP message to effectively use IRC.
191 |
192 | Examples:
193 |
194 | ~~~
195 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION does it!\x01
196 |
197 | Formatted: * dan does it!
198 | ~~~
199 |
200 | ~~~
201 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION \x01
202 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION\x01
203 | Raw: :dan!user@host PRIVMSG #ircv3 :\x01ACTION
204 |
205 | Formatted: * dan
206 | ~~~
207 |
208 |
209 | ## CLIENTINFO
210 |
211 | ~~~
212 | Type: Extended Query
213 | Reply: CLIENTINFO
214 | ~~~
215 |
216 | This extended query returns a list of the CTCP messages that this client supports and implements, delimited by a single ASCII space.
217 |
218 | CLIENTINFO is widely implemented. Clients SHOULD implement this CTCP message.
219 |
220 | Example:
221 |
222 | ~~~
223 | Query: CLIENTINFO
224 | Response: CLIENTINFO ACTION DCC CLIENTINFO PING TIME VERSION
225 | ~~~
226 |
227 |
228 | ## DCC
229 |
230 | ~~~
231 | Type: Extended Query
232 | Params: DCC
233 | ~~~
234 |
235 | This extended query sets up and controls connections that go directly between clients, bypassing the IRC server. This is typically used for features that require a large amount of traffic between clients or simply wish to bypass the server itself such as file transfer and direct chat.
236 |
237 | The Direct Client-to-Client (DCC) Protocol requires its own specification, and is not described in-depth here.
238 |
239 | DCC is widely implemented. Clients MAY implement this CTCP message.
240 |
241 |
242 | ## FINGER
243 |
244 | ~~~
245 | Type: Metadata Query
246 | Reply: FINGER
247 | ~~~
248 |
249 | This metadata query returns miscellaneous info about the user, typically the same information that’s held in their realname field.
250 |
251 | However, some implementations return the client name and version instead.
252 |
253 | FINGER is largely obsolete. Clients MAY implement this CTCP message.
254 |
255 | Example:
256 |
257 | ~~~
258 | Query: FINGER
259 | Response: FINGER WeeChat 1.8-dev
260 | ~~~
261 |
262 |
263 | ## PING
264 |
265 | ~~~
266 | Type: Extended Query
267 | Params: PING
268 | ~~~
269 |
270 | This extended query confirms reachability and latency to the target client. When receiving a CTCP PING, the reply MUST contain exactly the same parameters as the original query.
271 |
272 | PING is universally implemented. Clients SHOULD implement this CTCP message.
273 |
274 | Example:
275 |
276 | ~~~
277 | Query: PING 1473523721 662865
278 | Response: PING 1473523721 662865
279 |
280 | Query: PING foo bar baz
281 | Response: PING foo bar baz
282 | ~~~
283 |
284 |
285 | ## SOURCE
286 |
287 | ~~~
288 | Type: Metadata Query
289 | Reply: SOURCE
290 | ~~~
291 |
292 | This metadata query returns the location of the source code for the client.
293 |
294 | SOURCE is rarely implemented. Clients MAY implement this CTCP message.
295 |
296 | Example:
297 |
298 | ~~~
299 | Query: SOURCE
300 | Response: SOURCE https://weechat.org/download
301 | ~~~
302 |
303 |
304 | ## TIME
305 |
306 | ~~~
307 | Type: Extended Query
308 | Params: TIME
309 | ~~~
310 |
311 | This extended query returns the client’s local time in an unspecified human-readable format. In practice, both the format output by ctime() and the format described in Section 3.3 of {{!RFC5322}} are common. Earlier specifications recommended prefixing the time string with a colon, but this is no longer recommended.
312 |
313 | New implementations MAY default to UTC time for privacy reasons.
314 |
315 | TIME is almost universally implemented. Clients MAY implement this CTCP message.
316 |
317 | Example:
318 |
319 | ~~~
320 | Query: TIME
321 | Response: TIME Mon, 08 May 2017 09:15:29 GMT
322 | ~~~
323 |
324 |
325 | ## VERSION
326 |
327 | ~~~
328 | Type: Metadata Query
329 | Reply: VERSION
330 | ~~~
331 |
332 | This metadata query returns the name and version of the client software in use. There is no specified format for the version string.
333 |
334 | Clients may allow users to customise the response value for this query.
335 |
336 | VERSION is universally implemented. Clients SHOULD implement this CTCP message.
337 |
338 | Example:
339 |
340 | ~~~
341 | Query: VERSION
342 | Response: VERSION WeeChat 1.8-dev (git: v1.7-329-g22f2fd03a)
343 | ~~~
344 |
345 |
346 | ## USERINFO
347 |
348 | ~~~
349 | Type: Metadata Query
350 | Reply: USERINFO
351 | ~~~
352 |
353 | This metadata query returns miscellaneous info about the user, typically the same information that’s held in their realname field.
354 |
355 | However, some implementations return ` ()` instead.
356 |
357 | USERINFO is largely obsolete. Clients MAY implement this CTCP message.
358 |
359 | Example:
360 |
361 | ~~~
362 | Query: USERINFO
363 | Response: USERINFO fred (Fred Foobar)
364 | ~~~
365 |
366 | # Change History \[RFC Editor: Please remove this section\]
367 |
368 | Changes from draft 1 (July 18, 2017)
369 |
370 | - General editing, fixed mistypes.
371 | - Simplified some of the examples.
372 |
373 | Changes from draft 0 (May 29, 2017)
374 |
375 | - Added note about servers truncating CTCP messages (thanks Peter).
376 | - Fixed misspellings and added note to TIME about previously-recommended prefix (thanks Patrick).
377 | - Mentioned how to parse/send empty ACTION messages (thanks dequis and the crew).
378 |
--------------------------------------------------------------------------------
/lib/style.css:
--------------------------------------------------------------------------------
1 | /* retrieved as-is from https://github.com/martinthomson/i-d-template/blob/main/v3.css */
2 |
3 | /* @import url('https://martinthomson.github.io/i-d-template/fonts.css'); */
4 |
5 | html {
6 | --background-color: #fff;
7 | --text-color: #222;
8 | --title-color: #191919;
9 | --link-color: #2a6496;
10 | --highlight-color: #f9f9f9;
11 | --line-color: #eee;
12 | --pilcrow-weak: #ddd;
13 | --pilcrow-strong: #bbb;
14 | --small-font-size: 14.5px;
15 | scrollbar-color: #bbb #eee;
16 | }
17 | @media (prefers-color-scheme: dark) {
18 | html {
19 | --background-color: #121212;
20 | --text-color: #f0f0f0;
21 | --title-color: #fff;
22 | --link-color: #4da4f0;
23 | --highlight-color: #282828;
24 | --line-color: #444;
25 | --pilcrow-weak: #444;
26 | --pilcrow-strong: #666;
27 | scrollbar-color: #777 #333;
28 | }
29 | }
30 | body {
31 | max-width: 600px;
32 | margin: 75px auto;
33 | padding: 0 5px;
34 | color: var(--text-color);
35 | background-color: var(--background-color);
36 | font: 16px/22px "Lora", serif;
37 | scroll-behavior: smooth;
38 | }
39 |
40 | .ears {
41 | display: none;
42 | }
43 |
44 | /* headings */
45 | #title, h1, h2, h3, h4, h5, h6 {
46 | font-family: "Cabin Condensed", sans-serif;
47 | font-weight: 600;
48 | margin: 0.8em 0 0.3em;
49 | font-size-adjust: 0.5;
50 | color: var(--title-color);
51 | }
52 | #title {
53 | padding: 1em 0 0.2em;
54 | font-size: 32px;
55 | line-height: 40px;
56 | clear: both;
57 | }
58 | h1, h2, h3 {
59 | font-size: 22px;
60 | line-height: 27px;
61 | }
62 | h4, h5, h6 {
63 | font-size: 20px;
64 | line-height: 24px;
65 | }
66 |
67 | /* general structure */
68 | .author {
69 | padding-bottom: 0.3em;
70 | }
71 | #abstract+p, #abstract+p code, #abstract+p samp, #abstract+p tt {
72 | font-size: 18px;
73 | line-height: 24px;
74 | }
75 | p {
76 | padding: 0;
77 | margin: 0.5em 0;
78 | text-align: left;
79 | }
80 | div {
81 | margin: 0;
82 | }
83 | .alignRight.art-text {
84 | background-color: var(--highlight-color);
85 | border: 1px solid var(--line-color);
86 | border-radius: 3px;
87 | padding: 0.5em 1em 0;
88 | margin-bottom: 0.5em;
89 | }
90 | .alignRight.art-text pre {
91 | padding: 0;
92 | width: auto;
93 | }
94 | .alignRight {
95 | margin: 1em 0;
96 | }
97 | .alignRight > *:first-child {
98 | border: none;
99 | margin: 0;
100 | float: right;
101 | clear: both;
102 | }
103 | .alignRight > *:nth-child(2) {
104 | clear: both;
105 | display: block;
106 | border: none;
107 | }
108 | svg {
109 | display: block;
110 | }
111 | .alignCenter.art-text {
112 | background-color: var(--highlight-color);
113 | border: 1px solid var(--line-color);
114 | border-radius: 3px;
115 | padding: 0.5em 1em 0;
116 | margin-bottom: 0.5em;
117 | }
118 | .alignCenter.art-text pre {
119 | padding: 0;
120 | width: auto;
121 | }
122 | .alignCenter {
123 | margin: 1em 0;
124 | }
125 | .alignCenter > *:first-child {
126 | border: none;
127 | /* this isn't optimal, but it's an existence proof. PrinceXML doesn't
128 | support flexbox yet.
129 | */
130 | display: table;
131 | margin: 0 auto;
132 | }
133 |
134 | /* lists */
135 | ol, ul {
136 | padding: 0;
137 | margin: 0 0 0.5em 2em;
138 | }
139 | ol ol, ul ul, ol ul, ul ol {
140 | margin-left: 1em;
141 | }
142 | li {
143 | margin: 0 0 0.25em 0;
144 | }
145 | .ulCompact li {
146 | margin: 0;
147 | }
148 | ul.empty, .ulEmpty {
149 | list-style-type: none;
150 | }
151 | ul.empty li, .ulEmpty li {
152 | margin-top: 0.5em;
153 | }
154 | ul.compact, .ulCompact,
155 | ol.compact, .olCompact {
156 | line-height: 100%;
157 | margin: 0 0 0 2em;
158 | }
159 |
160 | /* definition lists */
161 | dl {
162 | }
163 | dl > dt {
164 | float: left;
165 | margin-right: 1em;
166 | }
167 | dl > dd {
168 | margin-bottom: .8em;
169 | min-height: 1.3em;
170 | }
171 | dl.compact > dd, .dlCompact > dd {
172 | margin-bottom: 0em;
173 | }
174 | dl > dd > dl {
175 | margin-top: 0.5em;
176 | margin-bottom: 0em;
177 | }
178 | dd.break {
179 | display: none;
180 | }
181 |
182 | /* links */
183 | a, a[href].selfRef:hover {
184 | text-decoration: none;
185 | }
186 | a[href].selfRef {
187 | color: var(--text-color);
188 | }
189 | a[href] {
190 | color: var(--link-color);
191 | }
192 | a[href]:hover {
193 | text-decoration: underline;
194 | }
195 | a[href].selfRef:hover {
196 | background-color: var(--highlight-color);
197 | }
198 | a.xref {
199 | white-space: nowrap;
200 | }
201 |
202 | /* Figures */
203 | tt, code, pre {
204 | background-color: var(--highlight-color);
205 | font: 14px/22px 'Oxygen Mono', monospace;
206 | }
207 | pre {
208 | border: 1px solid var(--line-color);
209 | font-size: 13.5px;
210 | line-height: 16px;
211 | letter-spacing: -0.2px;
212 | margin: 5px;
213 | padding: 5px;
214 | }
215 | img {
216 | max-width: 100%;
217 | }
218 | figure {
219 | margin: 0.5em 0;
220 | padding: 0;
221 | }
222 | figure blockquote {
223 | margin: 0.8em 0.4em 0.4em;
224 | }
225 | figcaption, caption {
226 | font-style: italic;
227 | margin: 0.5em 1.5em;
228 | text-align: left;
229 | }
230 | @media screen {
231 | pre {
232 | display: inline-block;
233 | overflow-x: auto;
234 | max-width: 100%;
235 | width: calc(100% - 22px - 1em);
236 | }
237 | figure pre {
238 | display: block;
239 | width: calc(100% - 25px);
240 | }
241 | pre + .pilcrow {
242 | display: inline-block;
243 | vertical-align: text-bottom;
244 | padding-bottom: 8px;
245 | }
246 | }
247 |
248 | /* aside, blockquote */
249 | aside, blockquote {
250 | margin-left: 0;
251 | padding: 0 2em;
252 | font-style: italic;
253 | }
254 | blockquote {
255 | background-color: var(--highlight-color);
256 | border: 1px solid var(--line-color);
257 | border-radius: 3px;
258 | margin: 1em 0;
259 | }
260 | cite {
261 | display: block;
262 | text-align: right;
263 | font-style: italic;
264 | }
265 |
266 | /* tables */
267 | table {
268 | max-width: 100%;
269 | margin: 0 0 1em;
270 | border-collapse: collapse;
271 | }
272 | table.right {
273 | margin-left: auto;
274 | }
275 | table.center {
276 | margin-left: auto;
277 | margin-right: auto;
278 | }
279 | table.left {
280 | margin-right: auto;
281 | }
282 | thead, tbody {
283 | border: 1px solid var(--line-color);
284 | }
285 | th, td {
286 | text-align: left;
287 | vertical-align: top;
288 | padding: 5px 10px;
289 | }
290 | th {
291 | background-color: var(--line-color);
292 | }
293 | tr:nth-child(2n) > td {
294 | background-color: var(--background-color);
295 | }
296 | tr:nth-child(2n+1) > td {
297 | background-color: var(--highlight-color);
298 | }
299 | thead+tbody > tr:nth-child(2n) > td {
300 | background-color: var(--highlight-color);
301 | }
302 | thead+tbody > tr:nth-child(2n+1) > td {
303 | background-color: var(--background-color);
304 | }
305 | table caption {
306 | margin: 0;
307 | padding: 3px 0 3px 1em;
308 | }
309 | table p {
310 | margin: 0;
311 | }
312 |
313 | /* pilcrow */
314 | a.pilcrow {
315 | margin-left: 3px;
316 | opacity: 0; /* dan: opacity was 0.2 in stock. felt distracting? */
317 | user-select: none;
318 | }
319 | a.pilcrow[href] { color: var(--pilcrow-weak); }
320 | a.pilcrow[href]:hover { text-decoration: none; }
321 | @media not print {
322 | :hover > a.pilcrow {
323 | opacity: 1;
324 | }
325 | a.pilcrow[href]:hover {
326 | color: var(--pilcrow-strong);
327 | background-color: transparent;
328 | }
329 | }
330 | @media print {
331 | a.pilcrow {
332 | display: none;
333 | }
334 | }
335 |
336 | /* misc */
337 | hr {
338 | border: 0;
339 | border-top: 1px solid var(--line-color);
340 | }
341 | .bcp14 {
342 | font-variant: small-caps;
343 | }
344 |
345 | .role {
346 | font-variant: all-small-caps;
347 | }
348 |
349 | /* info block */
350 | #identifiers {
351 | margin: 0;
352 | font-size: var(--small-font-size);
353 | line-height: 18px;
354 | --identifier-width: 8em;
355 | }
356 | #identifiers dt {
357 | width: var(--identifier-width);
358 | margin: 0;
359 | clear: left;
360 | float: left;
361 | text-align: right;
362 | }
363 | #identifiers dd {
364 | margin: 0 0 0 calc(1em + var(--identifier-width));
365 | min-width: 5em;
366 | }
367 | #identifiers .authors .author {
368 | display: inline-block;
369 | margin-right: 1.5em;
370 | }
371 | #identifiers .authors .org {
372 | font-style: italic;
373 | }
374 |
375 | /* The prepared/rendered info at the very bottom of the page */
376 | .docInfo {
377 | color: #999;
378 | font-size: 0.9em;
379 | font-style: italic;
380 | margin-top: 2em;
381 | }
382 | .docInfo .prepared {
383 | float: left;
384 | }
385 | .docInfo .prepared {
386 | float: right;
387 | }
388 |
389 | /* table of contents */
390 | #toc {
391 | padding: 0.75em 0 2em 0;
392 | margin-bottom: 1em;
393 | }
394 | #toc nav ul {
395 | margin: 0 0.5em 0 0;
396 | padding: 0;
397 | list-style: none;
398 | }
399 | #toc nav li {
400 | line-height: 1.3em;
401 | margin: 0.75em 0;
402 | padding-left: 1.2em;
403 | text-indent: -1.2em;
404 | }
405 | #toc a.xref {
406 | white-space: normal;
407 | }
408 | /* references */
409 | .references dt {
410 | text-align: right;
411 | font-weight: bold;
412 | min-width: 7em;
413 | }
414 | .references dd {
415 | margin-left: 8em;
416 | overflow: auto;
417 | }
418 |
419 | .refInstance {
420 | margin-bottom: 1.25em;
421 | }
422 |
423 | .references .ascii {
424 | margin-bottom: 0.25em;
425 | }
426 |
427 | /* index */
428 | .index ul {
429 | margin: 0 0 0 1em;
430 | padding: 0;
431 | list-style: none;
432 | }
433 | .index ul ul {
434 | margin: 0;
435 | }
436 | .index li {
437 | margin: 0;
438 | text-indent: -2em;
439 | padding-left: 2em;
440 | padding-bottom: 5px;
441 | }
442 | .indexIndex {
443 | margin: 0.5em 0 1em;
444 | }
445 | .index a {
446 | font-weight: 700;
447 | }
448 | /* make the index two-column on all but the smallest screens */
449 | @media (min-width: 500px) {
450 | .index ul {
451 | column-count: 2;
452 | column-gap: 20px;
453 | }
454 | .index ul ul {
455 | column-count: 1;
456 | column-gap: 0;
457 | }
458 | }
459 |
460 | /* authors */
461 | address.vcard {
462 | font-style: normal;
463 | margin: 1em 0;
464 | }
465 | address.vcard .nameRole {
466 | font-weight: 700;
467 | margin-left: 0;
468 | }
469 | address.vcard .label {
470 | margin: 0.5em 0;
471 | }
472 | address.vcard .type {
473 | display: none;
474 | }
475 | .alternative-contact {
476 | margin: 1.5em 0 1em;
477 | }
478 | hr.addr {
479 | border-top: 1px dashed;
480 | margin: 0;
481 | color: #ddd;
482 | max-width: calc(100% - 16px);
483 | }
484 | @media (min-width: 500px) {
485 | #authors-addresses > section {
486 | column-count: 2;
487 | column-gap: 20px;
488 | }
489 | #authors-addresses > section > h2 {
490 | column-span: all;
491 | }
492 | /* hack for break-inside: avoid-column */
493 | #authors-addresses address {
494 | display: inline-block;
495 | break-inside: avoid-column;
496 | }
497 | }
498 |
499 | .rfcEditorRemove p:first-of-type {
500 | font-style: italic;
501 | }
502 | .cref {
503 | background-color: rgba(249, 232, 105, 0.3);
504 | padding: 2px 4px;
505 | }
506 | .crefSource {
507 | font-style: italic;
508 | }
509 | /* alternative layout for smaller screens */
510 | @media screen and (max-width: 929px) {
511 | #toc {
512 | position: fixed;
513 | z-index: 2;
514 | top: 0;
515 | right: 0;
516 | padding: 0;
517 | margin: 0;
518 | border-bottom: 1px solid #ccc;
519 | opacity: 0.6;
520 | }
521 | #toc.active {
522 | opacity: 1;
523 | }
524 | #toc h2 {
525 | margin: 0;
526 | padding: 2px 0 2px 6px;
527 | padding-right: 1em;
528 | font-size: 18px;
529 | line-height: 24px;
530 | min-width: 190px;
531 | text-align: right;
532 | background-color: #444;
533 | color: white;
534 | cursor: pointer;
535 | }
536 | #toc h2::before { /* css hamburger */
537 | float: right;
538 | position: relative;
539 | width: 1em;
540 | height: 1px;
541 | left: -164px;
542 | margin: 8px 0 0 0;
543 | background: white none repeat scroll 0 0;
544 | box-shadow: 0 4px 0 0 white, 0 8px 0 0 white;
545 | content: "";
546 | }
547 | #toc nav {
548 | display: none;
549 | background-color: var(--background-color);
550 | padding: 0.5em 1em 1em;
551 | overflow: auto;
552 | overscroll-behavior: contain;
553 | height: calc(100vh - 48px);
554 | border-left: 1px solid #ddd;
555 | }
556 | #toc.active nav {
557 | display: block;
558 | }
559 | /* Make the collapsed ToC header render white on gray also when it's a link */
560 | #toc h2 a,
561 | #toc h2 a:link,
562 | #toc h2 a:focus,
563 | #toc h2 a:hover,
564 | #toc a.toplink,
565 | #toc a.toplink:hover {
566 | color: white;
567 | background-color: #444;
568 | text-decoration: none;
569 | }
570 | #toc a.toplink {
571 | margin-top: 2px;
572 | }
573 | }
574 |
575 | /* alternative layout for wide screens */
576 | @media screen and (min-width: 930px) {
577 | body {
578 | padding-right: 360px;
579 | padding-right: calc(min(180px + 20%, 500px));
580 | }
581 | #toc {
582 | position: fixed;
583 | bottom: 0;
584 | right: 0;
585 | right: calc(50vw - 480px);
586 | width: 312px;
587 | margin: 0;
588 | padding: 0;
589 | z-index: 1;
590 | }
591 | #toc h2 {
592 | margin: 0;
593 | padding: 0.25em 1em 1em 0;
594 | }
595 | #toc nav {
596 | display: block;
597 | height: calc(90vh - 84px);
598 | bottom: 0;
599 | padding: 0.5em 0 2em;
600 | overflow: auto;
601 | overscroll-behavior: contain;
602 | scrollbar-width: thin;
603 | }
604 | #toc nav > ul {
605 | margin-bottom: 2em;
606 | }
607 | #toc ul {
608 | margin: 0 0 0 4px;
609 | font-size: var(--small-font-size);
610 | }
611 | #toc ul p, #toc ul li {
612 | margin: 2px 0;
613 | line-height: 22px;
614 | }
615 | img { /* future proofing */
616 | max-width: 100%;
617 | height: auto;
618 | }
619 | }
620 |
621 | /* pagination */
622 | @media print {
623 | body {
624 | width: 100%;
625 | }
626 | p {
627 | orphans: 3;
628 | widows: 3;
629 | }
630 | #n-copyright-notice {
631 | border-bottom: none;
632 | }
633 | #toc, #n-introduction {
634 | page-break-before: always;
635 | }
636 | #toc {
637 | border-top: none;
638 | padding-top: 0;
639 | }
640 | figure, pre {
641 | page-break-inside: avoid;
642 | }
643 | figure {
644 | overflow: scroll;
645 | }
646 | h1, h2, h3, h4, h5, h6 {
647 | page-break-after: avoid;
648 | }
649 | h2+*, h3+*, h4+*, h5+*, h6+* {
650 | page-break-before: avoid;
651 | }
652 | pre {
653 | white-space: pre-wrap;
654 | word-wrap: break-word;
655 | font-size: 10pt;
656 | }
657 | table {
658 | border: 1px solid #ddd;
659 | }
660 | td {
661 | border-top: 1px solid #ddd;
662 | }
663 | }
664 |
665 | @page :first {
666 | padding-top: 0;
667 | @top-left {
668 | content: normal;
669 | border: none;
670 | }
671 | @top-center {
672 | content: normal;
673 | border: none;
674 | }
675 | @top-right {
676 | content: normal;
677 | border: none;
678 | }
679 | }
680 |
681 | @page {
682 | size: A4;
683 | margin-bottom: 45mm;
684 | padding-top: 20px;
685 | }
686 |
687 | /* Changes introduced to fix issues found during implementation */
688 |
689 | /* Separate body from document info even without intervening H1 */
690 | section {
691 | clear: both;
692 | }
693 |
694 | /* Top align author divs, to avoid names without organization dropping level with org names */
695 | .author {
696 | vertical-align: top;
697 | }
698 |
699 | /* Style section numbers with more space between number and title */
700 | .section-number {
701 | padding-right: 0.5em;
702 | }
703 |
704 | /* Add styling for a link in the ToC that points to the top of the document */
705 | a.toplink {
706 | float: right;
707 | margin: 8px 0.5em 0;
708 | }
709 |
710 | /* Fix the dl styling to match the RFC 7992 attributes */
711 | dl > dt,
712 | dl.dlParallel > dt {
713 | float: left;
714 | margin-right: 1em;
715 | }
716 | dl.dlNewline > dt {
717 | float: none;
718 | }
719 |
720 | /* Provide styling for table cell text alignment */
721 | table .text-left, table .text-left {
722 | text-align: left;
723 | }
724 | table .text-center, table .text-center {
725 | text-align: center;
726 | }
727 | table .text-right, table .text-right {
728 | text-align: right;
729 | }
730 |
731 | /* Make the alternative author contact information look less like just another
732 | author, and group it closer with the primary author contact information */
733 | .alternative-contact {
734 | margin: 0.5em 0 0.25em 0;
735 | }
736 | address .non-ascii {
737 | margin: 0 0 0 2em;
738 | }
739 |
740 | /* With it being possible to set tables with alignment
741 | left, center, and right, { width: 100%; } does not make sense */
742 | table {
743 | width: auto;
744 | }
745 |
746 | /* Avoid reference text that sits in a block with very wide left margin,
747 | because of a long floating dt label.*/
748 | .references dd {
749 | overflow: visible;
750 | }
751 |
752 | /* Control caption placement */
753 | caption {
754 | caption-side: bottom;
755 | }
756 |
757 | /* Limit the width of the author address vcard, so names in right-to-left
758 | script don't end up on the other side of the page. */
759 |
760 | address.vcard {
761 | max-width: 20em;
762 | margin-right: auto;
763 | }
764 |
765 | /* For address alignment dependent on LTR or RTL scripts */
766 | address div.left {
767 | text-align: left;
768 | }
769 | address div.right {
770 | text-align: right;
771 | }
772 |
773 | /* Give the table caption label the same styling as the figcaption */
774 |
775 | @media print {
776 | .toplink {
777 | display: none;
778 | }
779 |
780 | /* avoid overwriting the top border line with the ToC header */
781 | #toc {
782 | padding-top: 1px;
783 | }
784 |
785 | /* Avoid page breaks inside dl and author address entries */
786 | dd {
787 | page-break-before: avoid;
788 | }
789 | .vcard {
790 | page-break-inside: avoid;
791 | }
792 |
793 | }
794 | /* Tweak the bcp14 keyword presentation */
795 | .bcp14 {
796 | font-variant: small-caps;
797 | font-weight: bold;
798 | font-size: 0.9em;
799 | }
--------------------------------------------------------------------------------
/dist/draft-oakley-irc-client-latest.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 | Internet Relay Chat Client Protocol
9 |
10 |
11 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
Network Working Group
307 |
D. Oakley, Ed.
308 |
309 |
310 |
Internet-Draft
311 |
ircdocs
312 |
313 |
314 |
Obsoletes: 1459, 2810, 2811, 2812 (if
315 |
J. Allnutt
316 |
317 |
318 |
approved)
319 |
Kiwi IRC
320 |
321 |
322 |
Intended status: Informational
323 |
May 28, 2017
324 |
325 |
326 |
Expires: November 29, 2017
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
Internet Relay Chat Client Protocol
335 | draft-oakley-irc-client-latest
The Internet Relay Chat (IRC) protocol has been designed over a number of years, with multitudes of implementations and use cases appearing. This document describes the IRC Client-Server protocol.
341 |
IRC is a text-based chat protocol which has proven itself valuable and useful. It is well-suited to running on many machines in a distributed fashion. A typical setup involves multiple servers connected in a distributed network. Messages are delivered through this network and state is maintained across it for the connected clients and active channels.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
346 |
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
347 |
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
348 |
This Internet-Draft will expire on November 29, 2017.
Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved.
353 |
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.
The Internet Relay Chat (IRC) protocol has been designed over a number of years, with multitudes of implementations and use cases appearing. This document describes the IRC Client-Server protocol.
372 |
IRC is a text-based chat protocol which has proven itself valuable and useful. It is well-suited to running on many machines in a distributed fashion. A typical setup involves multiple servers connected in a distributed network. Messages are delivered through this network and state is maintained across it for the connected clients and active channels.
373 |
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC2119].
A typical IRC network consists of servers and clients connected to those servers, with a good mix of IRC operators and channels. This section goes through each of those, what they are and a brief overview of them.
Servers form the backbone of IRC, providing a point to which clients may connect and talk to each other, and a point for other servers to connect to, forming an IRC network.
380 |
The most common network configuration for IRC servers is that of a spanning tree, where each server acts as a central node for the rest of the network it sees. Other topologies are being experimented with, but right there are no others widely used in production.
381 |
382 |
383 |
384 | [ Server 15 ] [ Server 13 ] [ Server 14 ]
385 | / \ /
386 | / \ /
387 | [ Server 11 ] ------ [ Server 1 ] [ Server 12 ]
388 | / \ /
389 | / \ /
390 | [ Server 2 ] [ Server 3 ]
391 | / \ \
392 | / \ \
393 | [ Server 4 ] [ Server 5 ] [ Server 6 ]
394 | / | \ /
395 | / | \ /
396 | / | \____ /
397 | / | \ /
398 | [ Server 7 ] [ Server 8 ] [ Server 9 ] [ Server 10 ]
399 |
400 | :
401 | [ etc. ]
402 | :
403 |
404 |
Figure 1: Format of a typical IRC network
405 |
There have been several terms created over time to describe the roles of different servers on an IRC network. Some of the most common terms are as follows:
406 |
407 |
408 |
409 |
Hub: A hub is a server that connects to multiple other servers. For instance, in the figure above, Server 2, Server 3, and Server 4 would be examples of hub servers.
410 |
Core Hub: A core hub is typically a hub server that connects fairly major parts of the IRC network together. What is considered a core hub will change depending on the size of a network and what the administrators of the network consider important. For instance, in the figure above, Server 1, Server 2, and Server 3 may be considered core hubs by the network administrators.
411 |
Leaf: A leaf is a server that is only connected to a single other server on the network. Typically, leafs are the primary servers that handle client connections. In the figure above, Servers 7, 8, 10, 13, 14, and others would be considered leaf servers.
412 |
Services: A services server is a special type of server that extends the capabilities of the server software on the network (ie, they provide services to the network). Services are not used on all networks, and the capabilities typically provided by them may be built-into server software itself rather than being provided by a separate software package. Features usually handled by services include client account registration (as are typically used for SASL authentication), channel registration (allowing client accounts to ‘own’ channels), and further modifications and extensions to the IRC protocol. ‘Services’ themselves are not specified in any way by the protocol. What they provide depends entirely on the software packages being run.
413 |
414 |
A trend these days is to hide the real structure of a network from regular users. Networks that implement this may restrict or modify commands like MAP so that regular users see every other server on the network as linked directly to the current server. When this is done, servers that do not handle client connections may also be hidden from users (hubs hidden in this way can be called ‘hidden hubs’). Generally, IRC operators can always see the true structure of a network.
415 |
These terms are not generally used in IRC protocol documentation, but may be used by the administrators of a network in order to differentiate the servers they run and their roles.