Skip to content

Commit

Permalink
add simple connect js func
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Dec 7, 2018
1 parent 3e7f20f commit b3f07cf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion web/static/js/beaver.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* Beaver Client
*/
*/

function Socket(url){
ws = new WebSocket(url);
ws.onmessage = function(e) { console.log(e); };
ws.onclose = function(){
// Try to reconnect in 5 seconds
setTimeout(function(){Socket(url)}, 5000);
};
}

0 comments on commit b3f07cf

Please sign in to comment.