UNPKG

node-simple-router

Version:

Yet another minimalistic router for node.js

25 lines (22 loc) 732 B
// Generated by CoffeeScript 1.10.0 (function() { var createWs; createWs = function() { var ws; ws = new WebSocket('ws://savos.ods.org:8000'); ws.onopen = function(evt) { return console.log('socket opened', evt); }; ws.onclose = function(evt) { return console.log('socket closed.', evt != null ? evt.wasClean : void 0, evt != null ? evt.code : void 0, evt != null ? evt.reason : void 0); }; ws.onerror = function(evt) { var ref; return console.log('socket error:', evt != null ? (ref = evt.error) != null ? ref.message : void 0 : void 0); }; ws.onmessage = function(evt) { return console.log("Received: " + evt.data); }; return ws; }; }).call(this);