Browse Source

add some documentation; default to existing websocket transport

Mike Tinglof 13 years ago
parent
commit
d38db74abd
4 changed files with 19 additions and 7 deletions
  1. 1 1
      README.md
  2. 3 0
      include/jsunzip.js
  3. 13 6
      include/rfb.js
  4. 2 0
      include/vnc.js

+ 1 - 1
README.md

@@ -26,7 +26,7 @@ their products including: [Ganeti Web Manager](http://code.osuosl.org/projects/g
 * Easy site integration and theming (3 example themes included)
 * Licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl.html)
 
-
+* Support for tight encoding (contributed by Mercuri.ca)
 
 ### Screenshots
 

+ 3 - 0
include/jsunzip.js

@@ -195,6 +195,9 @@ function JSUnzip() {
 /*
  * tinflate javascript port by Erik Moller in May 2011.
  * emoller@opera.com
+ * 
+ * read_bits() patched by mike@imidio.com to allow
+ * reading more then 8 bits (needed in some zlib streams)
  */
 
 "use strict";

+ 13 - 6
include/rfb.js

@@ -4,6 +4,9 @@
  * Licensed under LGPL-3 (see LICENSE.txt)
  *
  * See README.md for usage and integration instructions.
+ *
+ * TIGHT decoder portion:
+ * (c) 2012 Michael Tinglof, Joe Balaz, Les Piech (Mercuri.ca)
  */
 
 /*jslint white: false, browser: true, bitwise: false, plusplus: false */
@@ -275,14 +278,18 @@ function constructor() {
 
 function connect() {
     Util.Debug(">> RFB.connect");
-
-    var uri = "";
-    if (conf.encrypt) {
-        uri = "wss://";
+    var uri;
+    
+    if (typeof UsingSocketIO !== "undefined") {
+        uri = "http://" + rfb_host + ":" + rfb_port + "/" + rfb_path;
     } else {
-        uri = "ws://";
+        if (conf.encrypt) {
+            uri = "wss://";
+        } else {
+            uri = "ws://";
+        }
+        uri += rfb_host + ":" + rfb_port + "/" + rfb_path;
     }
-    uri += rfb_host + ":" + rfb_port + "/" + rfb_path;
     Util.Info("connecting to " + uri);
     ws.open(uri);
 

+ 2 - 0
include/vnc.js

@@ -32,9 +32,11 @@ function get_INCLUDE_URI() {
     extra += start + "webutil.js" + end;
     extra += start + "base64.js" + end;
     extra += start + "websock.js" + end;
+    // extra += start + "socketio.js" + end;
     extra += start + "des.js" + end;
     extra += start + "input.js" + end;
     extra += start + "display.js" + end;
+    extra += start + "blowfish.js" + end;
     extra += start + "rfb.js" + end;
     extra += start + "jsunzip.js" + end;