I have this code
window.app = {};
app.BrainSocket = new BrainSocket(
new WebSocket('ws://localhost:8080'),
new BrainSocketPubSub()
);
app.BrainSocket.message('server.some_event',{data:'some_data'});
app.BrainSocket.Event.listen('client.some_event',function(msg){
//data returned from laravel
console.log(msg);
//msg.server.data has the data "This event was fired from the server"
});
And this error in chrome
Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': already in CONNECTING state.