Okay/Spec: Difference between revisions

Tags: Mobile edit Mobile web edit
No edit summary
Line 10: Line 10:
span.multiple, .multiple code {
span.multiple, .multiple code {
color: var(--colour-yellow-700);
color: var(--colour-yellow-700);
}
ul {
  list-style-type: "❊ ";
  list-style-image: none;
}
}


Line 24: Line 29:
Okay is a group chat protocol. You join “Rooms” which contain “People” who “Talk” by sending and receiving “Messages” to and fro the “Server”.
Okay is a group chat protocol. You join “Rooms” which contain “People” who “Talk” by sending and receiving “Messages” to and fro the “Server”.


A room is just a special URI which you can POST messages to and GET them back from at a later date.
* A room is just a special URI which you can POST messages to and GET them back from at a later date.
 
* You can use WebSockets to get a real-time feed of events that you’re interested in.
You can use WebSockets to get a real-time feed of events that you’re interested in.
* Events are represented as HTML over the wire. This allows most client implementations skip the bit where they convert every message into HTML, while providing a stable format for non-web platforms to convert into their own inferior representations. This also lets you do really really stupid things with your messages.
 
* Every client is authenticated with a certificate that gets generated by the client on first use.
Events are represented as HTML over the wire. This allows most client implementations skip the bit where they convert every message into HTML, while providing a stable format for non-web platforms to convert into their own inferior representations. This also lets you do really really stupid things with your messages.
 
Every client is authenticated with a TLS certificate that gets generated by the client on first use.


== conventions ==
== conventions ==
Line 44: Line 46:
A typical connection to an never before seen server usually goes like this:
A typical connection to an never before seen server usually goes like this:


The user hands the client a URI to examine;
* The user hands the client a URI to examine;


The client issues a GET request to the URI and examines the response;
* The client issues a GET request to the URI and examines the response;


If the response meets all the [[Okay#discovery|discovery requirements]], it generates a new certificate and registers itself with the server’s registration endpoint;
* If the response meets all the [[Okay#discovery|discovery requirements]], it generates a new certificate and registers itself with the server’s registration endpoint;


Once everyone’s happy, the client can begin posting messages to rooms.
* Once everyone’s happy, the client can begin posting messages to rooms.


== servers ==
== servers ==
Line 104: Line 106:
The '''Room Directory''' is a list of every room on the server. This list may be [[Okay#pagination|paginated]].
The '''Room Directory''' is a list of every room on the server. This list may be [[Okay#pagination|paginated]].


The path to the server's room directory must be defined in the its [[Okay#the element thereof|discovery element]] using the <code>ok-rooms</code> rel value.
The path to the server's room directory <span class="must">must</span> be defined in its [[Okay#the element thereof|discovery element]] with the <code>ok-rooms</code> rel value.


Here's an example of what a room directory might look like:
Here's an example of what a room directory might look like: