var conn = new WebSocket('ws://localhost:8080');
conn.onopen = function(e) {
    console.log("Connection established!");
};

conn.onclose = function(e){
    console.log("Connection closed!");
}

conn.onmessage = function(e) {
    actions(JSON.parse(e.data));
};