octoblu / meshblu

Meshblu is a cross-protocol IoT machine-to-machine messaging system.
https://meshblu.readme.io/
MIT License
816 stars 181 forks source link

`ready` event never fires on native WebSocket connection #114

Closed RickCarlino closed 8 years ago

RickCarlino commented 8 years ago

var ws = new WebSocket("wss://meshblu.octoblu.com/ws/v2");

ws.onopen = function() {
  console.log("Now I wait for the `ready` message...");
};

ws.onmessage = function(e) {
    console.log("Never gets called in this example.");
    console.dir(e.data);
};

Live example on REPL.IT

iamruinous commented 8 years ago

ready is fired after you successfully identity

https://github.com/octoblu/meshblu/blob/master/lib/MeshbluWebsocketHandler.coffee#L88