Index

websockets

open websocket
ws = new WebSocket(url);
sending a message
ws.send('hello world!');

events

on message
ws.onmessage = function(e) {
	console.log('received message: ' + e.data);
}
on open
ws.onopen = function() {
	console.log('socket open');
}
on close
ws.onclose = function() {
	console.log('closing socket');
}

links

websockets echo service
https://www.websocket.org/echo.html