<div dir="ltr">I got this going. Here is a gist if any one else happens upon this.<div><br></div><div><a href="https://gist.github.com/CalebEverett/bed94582b437ffe88f650819d772b682">https://gist.github.com/CalebEverett/bed94582b437ffe88f650819d772b682</a><br><div><br></div><div><div class="gmail_extra"><div class="gmail_quote">On Mon, May 2, 2016 at 11:27 AM, Caleb Everett <span dir="ltr"><<a href="mailto:caleb@calebeverett.io" target="_blank">caleb@calebeverett.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">I've been trying to get the websockets for the operations endpoint working. I was trying to submit a command to the <a href="https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10containersnameexec" target="_blank">exec endpoint</a> and then establish a websocket connection to interact with the command. I'm probably missing something basic, but if anyone were willing to send me a couple of links or some ideas about how to figure it out, that would be great.<div><br></div><div>My test case was to submit a command of "/bin/bash" with the "interactive": true and "wait-for-websocket": true. When I hit <a href="https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10operations" target="_blank">the operations</a> endpoint I can see that the process running. When I open up a secure websocket connection at <a href="https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10operationsuuidwebsocket" target="_blank">this</a> endpoint using <a href="https://chrome.google.com/webstore/detail/simple-websocket-client/pfdhoblngboilpfeibdedpjgfnlcodoo" target="_blank">this</a> Chrome extension, the connection opens and I can send commands through, but nothing ever comes back.</div><div><br></div><div>I also tried submitting a non-interactive command and opening up separate connections for each of the 0, 1 and 2 secrets and then sending commands through on the 0 connection to see if anything would come back on either the 1 or 2 connection, but nothing came back.</div><div><br></div><div>I also tried establishing the connections with a snippet in the Chrome console using the native browser <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API" target="_blank">Websocket</a> and also via nodejs with the <a href="https://github.com/websockets/ws" target="_blank">ws</a> package, but essentially got to the same place, which is opened connection, but not able to get any response back.</div><div><br></div><div>I found <a href="https://github.com/dobin/lxd-webgui" target="_blank">this project</a> which connects a javascript terminal to the streams, but I'd like to figure out how to interact with the endpoints programatically.</div><div><br></div><div>What else do I need to do to be able to exchange information with the websocket endpoints? Also, what does the secret for "control" do?</div><div><br></div><div>Lastly, is this this right forum for these kinds of questions? If they are too basic and I should be availing myself of alternative resources, I don't want to be out of school.</div><div><br></div><div>Thank you,</div></div>
</blockquote></div><br></div></div></div></div>