Re: get json sent to channels in view

2017-08-31 Thread Andrew Godwin
You want to look for incoming data on the "websocket.receive" channel, which will call you once per message you send down with the right data. That's "websocket.connect", which happens after the socket opens but before data is sent down it. Andrew On Wed, Aug 30, 2017 at 10:07 AM, Samuel Muiruri

get json sent to channels in view

2017-08-30 Thread Samuel Muiruri
I have this javascript code that send data to channels // Note that the path doesn't matter for routing; any WebSocket // connection gets bumped over to WebSocket consumers socket = new WebSocket("ws://" + window.location.host + "/chat/"); socket.onmessage = function(e) { alert(e.data); }