snapd events API

Robert Ancell robert.ancell at canonical.com
Wed Aug 17 02:24:26 UTC 2016


Hi,

I've been trying to access snapd events using the REST API [1] and I'm not
able to get it working.

When I do the websocket upgrade I send something like this:

GET /v2/events HTTP/1.1
Host:
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: ...
Sec-WebSocket-Version: 13

And snapd just returns:

HTTP/1.1 500 Internal Server Error
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Wed, 17 Aug 2016 02:23:25 GMT
Content-Length: 100

Internal Server Error
websocket upgrade failed: websocket: response does not implement
http.Hijacker

Googling around it seems like the Go code needs to implement some sort of
"Hijacker" interface.

Has anyone got the events support to work? Am I doing something wrong?

--Robert

[1] https://github.com/snapcore/snapd/blob/master/docs/rest.md
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160817/b4e4a43f/attachment.html>


More information about the Snapcraft mailing list