]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Show close code and reason.
authorJoel Martin <github@martintribe.org>
Thu, 15 Dec 2011 19:59:35 +0000 (13:59 -0600)
committerJoel Martin <github@martintribe.org>
Thu, 15 Dec 2011 19:59:35 +0000 (13:59 -0600)
Also add commented out web-socket-js debug variable in
include/websock.js

include/rfb.js
include/websock.js

index 9dceea72ec1e9b129eb7aa83da1b4df5399e7dd9..f68480463da41f56a93067c58d6ed35c95e979ef 100644 (file)
@@ -225,7 +225,10 @@ function constructor() {
             fail("Got unexpected WebSockets connection");
         }
     });
-    ws.on('close', function() {
+    ws.on('close', function(e) {
+        if (e.code) {
+            Util.Info("Close code: " + e.code + ", reason: " + e.reason + ", wasClean: " + e.wasClean);
+        }
         if (rfb_state === 'disconnect') {
             updateState('disconnected', 'VNC disconnected');
         } else if (rfb_state === 'ProtocolVersion') {
index a688f76f1724d7b2fe9a6539a422e040c33b10d1..f293ce8b7622b7f3a8643e32f23383bc3b279506 100644 (file)
@@ -24,6 +24,10 @@ if (window.WebSocket) {
     window.WebSocket = window.MozWebSocket;
 } else {
     /* no builtin WebSocket so load web_socket.js */
+
+    // To enable debug:
+    // window.WEB_SOCKET_DEBUG=1;
+
     Websock_native = false;
     (function () {
         function get_INCLUDE_URI() {