dEventListener('message', function (event) {
    console.log('Message from server ', event.data);
});
socket.addEventListener('close', function (event) {
    console.log('Connection closed', event);
});
socket.addEventListener('open', function (event) {
    send(socket, 'Hello Server!');
    send(socket, 'Good bye!');
});

</script>

</body>
</html>
