diff options
Diffstat (limited to 'proto.js')
-rw-r--r-- | proto.js | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -15,10 +15,10 @@ function get_appropriate_ws_url() return parser.href; } -var socket_task = new WebSocket(get_appropriate_ws_url(), "lws-task-protocol"); +var socket_node = new WebSocket(get_appropriate_ws_url(), "lws-node-protocol"); try { - socket_task.onopen = function() { + socket_node.onopen = function() { var connectEvent = new CustomEvent("connectEvent", { detail: { time: new Date(), @@ -29,7 +29,7 @@ try { document.dispatchEvent(connectEvent); } - socket_task.onmessage = function got_packet(msg) { + socket_node.onmessage = function got_packet(msg) { var messageEvent = new CustomEvent("messageEvent", { detail: { message: "recv [" + msg.data + "]", @@ -138,7 +138,7 @@ try { } } - socket_task.onclose = function(){ + socket_node.onclose = function(){ var disconnectEvent = new CustomEvent("disconnectEvent", { detail: { time: new Date(), @@ -165,7 +165,7 @@ function transmit(msg) }); document.dispatchEvent(messageEvent); - socket_task.send(msg); + socket_node.send(msg); } function login(user, password) |