]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Add support for passing the file name to get.
authorEd Schouten <ed@80386.nl>
Mon, 27 Jun 2011 08:55:03 +0000 (10:55 +0200)
committerEd Schouten <ed@80386.nl>
Mon, 27 Jun 2011 08:55:03 +0000 (10:55 +0200)
This change allows one to implement a single WebSockets proxy, which
multiplexes connections to different hosts.

include/rfb.js

index 8b9eb252bb16d64fff3c7a30e6fcfa636d4b6944..7bac47966c681d6e51c87885bb3ec11a0470ddae 100644 (file)
@@ -35,6 +35,7 @@ var that           = {},  // Public API methods
     rfb_host       = '',
     rfb_port       = 5900,
     rfb_password   = '',
+    rfb_uri        = '',
 
     rfb_state      = 'disconnected',
     rfb_version    = 0,
@@ -272,7 +273,7 @@ function connect() {
     } else {
         uri = "ws://";
     }
-    uri += rfb_host + ":" + rfb_port + "/";
+    uri += rfb_host + ":" + rfb_port + "/" + rfb_uri;
     Util.Info("connecting to " + uri);
     ws.open(uri);
 
@@ -1446,12 +1447,13 @@ clientCutText = function(text) {
 // Public API interface functions
 //
 
-that.connect = function(host, port, password) {
+that.connect = function(host, port, password, uri) {
     //Util.Debug(">> connect");
 
     rfb_host       = host;
     rfb_port       = port;
     rfb_password   = (password !== undefined)   ? password : "";
+    rfb_uri        = (uri !== undefined) ? uri : "";
 
     if ((!rfb_host) || (!rfb_port)) {
         return fail("Must set host and port");