Ошибка при отправке.
InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable
var connection = new WebSocket('ws://localhost:8080/events/ws/');
connection.onopen = function () {
console.log('Connection open!');
};
connection.onclose = function () {
console.log('Connection closed');
};
connection.onerror = function (error) {
console.log('Error detected: ' + error);
};
connection.onmessage = function (e) {
var server_message = e.data;
console.log(server_message);
};
// InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable
connection.send('Hey server, whats up?');