From 478307221691b684fe23442be9a95f56e1208669 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 23 Mar 2015 13:45:26 +0100 Subject: Update examples for Cockpit 0.41 or later --- content/cockpit/protocol-interaction.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'content/cockpit/protocol-interaction.md') diff --git a/content/cockpit/protocol-interaction.md b/content/cockpit/protocol-interaction.md index 4a71350..2f2e457 100644 --- a/content/cockpit/protocol-interaction.md +++ b/content/cockpit/protocol-interaction.md @@ -4,6 +4,8 @@ Category: Cockpit, Linux Tags: cockpit, linux Slug: protocol-for-web-access-to-system-apis +*Note: This post has been updated for changes in Cockpit 0.44 and later.* + A Linux system today has a lot of local system configuration APIs. I'm not talking about library APIs here, but things like DBus services, command/scripts to be executed, or files placed in various locations. All of these constitute the API by which we configure a Linux system. In [Cockpit](http://cockpit-project.org) we access these APIs from a web browser (after authentication of course). How do we access the system APIs? The answer is the `cockpit-bridge` tool. It proxies requests from the Cockpit user interface, running in a web browser, to the system. Typically the `cockpit-bridge` runs as the logged in user, in a user session. It has similar permissions and capabilities as if you had used `ssh` to log into the system. @@ -23,7 +25,7 @@ The protocol that the web browser uses is a [message based protocol](https://git The `cockpit-bridge` tool speaks this protocol on its standard in and standard output. The `cockpit-ws` process hosts the WebSocket and passes the messages to `cockpit-bridge` for processing. -**Following along:** In order to follow along with the stuff below, you'll need at least Cockpit 0.35. The protocol is not yet frozen, and we merged some cleanup recently. You can install it on [Fedora 21 using a COPR](https://lists.fedorahosted.org/pipermail/cockpit-devel/2014-November/000196.html) or [build it from git](https://github.com/cockpit-project/cockpit/blob/master/HACKING.md). +**Following along:** In order to follow along with the stuff below, you'll need at least Cockpit 0.44. The protocol is not yet frozen, and we merged some cleanup recently. You can install it on [Fedora 21 using a COPR](https://lists.fedorahosted.org/pipermail/cockpit-devel/2014-November/000196.html) or [build it from git](https://github.com/cockpit-project/cockpit/blob/master/HACKING.md). Channels -------- @@ -83,7 +85,7 @@ The `"echo"` channel type just sends the messages you send to the `cockpit-bridg Now we're ready to play ... Well almost. -The very first control message sent to and from `cockpit-bridge` must be an `"init"` message containing a version number. Currently that version number is `0` to indicate that protocol is not yet stable: +The very first control message sent to and from `cockpit-bridge` shuld be an `"init"` message containing a version number. Currently that version number is `0` to indicate that protocol is not yet stable:
 
@@ -105,9 +107,6 @@ In this debugging mode sent by `cockpit-bridge` will be bold in your terminal. N
 
 
 
-{ "command": "init", "version": 0 }
-----
-
 { "command": "open", "channel": "mychannel", "payload": "echo" }
 ----
 mychannel
-- 
cgit v1.2.3