summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2011-06-27 07:26:00 -0700
committerJoel Martin <github@martintribe.org>2011-06-27 07:26:00 -0700
commit95ff836e451c72ac27ac6a7e5f987520e47cfa58 (patch)
treeca94b1cbc2dad6c4b0425831086800ce99401990
parent68edd7f4f88bc914b7f08b00d465b7815157ad91 (diff)
parent3b8caa4b094c667014481bcd1954ecc0bc2f8231 (diff)
downloadnovnc-95ff836e451c72ac27ac6a7e5f987520e47cfa58.tar.gz
Merge pull request #67 from EdSchouten/master
Add support for setting the WebSocket URI path.
-rw-r--r--include/rfb.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/rfb.js b/include/rfb.js
index 8b9eb25..7bac479 100644
--- a/include/rfb.js
+++ b/include/rfb.js
@@ -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");