Okay/Spec: Difference between revisions

No edit summary
No edit summary
Line 17: Line 17:
== todo list ==
== todo list ==


* what “server” means is kind of nebulous
* what “server” means is kind of nebulous.


== connection flow ==
== connection flow ==
Line 23: Line 23:
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 discovery requirements, it generates a new certificate and registers itself with the server’s registration endpoint
✻ If the response meets all the 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.
Line 35: Line 35:
For a client to recognise a URI as an Okay protocol server, it must:
For a client to recognise a URI as an Okay protocol server, it must:


* Respond with 200 OK upon a GET request,
* Respond with 200 OK upon a GET request;
* Have a Content-Type of text/html,
* Have a Content-Type of text/html;
* Respond with a valid HTML document, -- TODO: define valid
* Respond with a valid HTML document, -- TODO: define valid;
* Have the Access-Control-Allow-Origin header set to *,
* Have the Access-Control-Allow-Origin header set to *;
* Contain a Discovery Element (scroll down, you’ll see).
* Contain a Discovery Element (scroll down, you’ll see).
TODO: what if there are multiple discovery elements?
TODO: what if there are multiple discovery elements?
Line 60: Line 60:
Key: ◈ Required, ◇ Optional, ❖ Can be specified multiple times
Key: ◈ Required, ◇ Optional, ❖ Can be specified multiple times


◈ ok-rooms — Points to a list of all rooms hosted by the server.
◈ ok-rooms — Points to a list of all rooms hosted by the server;


◈ ok-register — Points to the server’s registration endpoint.
◈ ok-register — Points to the server’s registration endpoint;


◈ ok-prefs — Points to the server’s preferences endpoint.
◈ ok-prefs — Points to the server’s preferences endpoint.