Rails 5 actioncable as a standalone server
<p>There's not TOO much documentation on action cable so I'm a little lost on this.
I'm playing with a rails 5 app, and I'm trying to use the rails5 app as purely an api and hosting my JS elsewhere. So when I start my actioncable server, i am able to connect to the websocket pretty easily just using my built in browser socket support with:</p>

<pre><code>var socket = new WebSocket('localhost:3000/cable')
// and then do
socket.onmessage = function(data) { console.log(data) }
</code></pre>

<p>I connect successfully. I'm getting pings in the form of</p>

<pre><code>MessageEvent {isTrusted: true, data: "{"type":"ping","message":1462992407}", ... etc
</code></pre>

<p>Except I can't seem to broadcast any messages down to the client. I tried:</p>

<pre><code>ActionCable.server.broadcast('test',{ yes: true })
</code></pre>

<p>But only the pings come in. ActionCable comes with its own concepts that I haven't wrapped my head around fully yet like channels and stuff which "just work" in rails apps. But how can I successfully build a separate standalone JS app using actioncable's socket server?</p>