summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2010-10-24 18:34:50 -0500
committerJoel Martin <github@martintribe.org>2010-10-24 18:34:50 -0500
commitf1a9971c820b99c16a39e4c351c7980be7afc039 (patch)
tree00f2c3ce0a7e456c40314d62dea1cc0ad6c7bf1b
parent65bca0c904032b54d0e37d22080153379475f2ea (diff)
downloadwebsockify-f1a9971c820b99c16a39e4c351c7980be7afc039.tar.gz
Expose VNC shared mode setting in UIs.
If shared mode is false, then the server should disconnect other connections before the current connection is allowed to proceed.
-rw-r--r--docs/TODO3
-rw-r--r--include/default_controls.js7
-rw-r--r--include/rfb.js4
-rw-r--r--vnc_auto.html7
4 files changed, 13 insertions, 8 deletions
diff --git a/docs/TODO b/docs/TODO
index 23b5ed4..e8d1200 100644
--- a/docs/TODO
+++ b/docs/TODO
@@ -6,8 +6,6 @@ Short Term:
- Test on IE 9 preview 3.
-- Test firefox 4
-
- Fix cursor URI detection in Arora:
- allows data URI, but doesn't actually work
@@ -22,7 +20,6 @@ Medium Term:
- Configuration menu:
- Tunable: speed vs. bandwidth selection
- Tunable: CPU use versus latency.
- - shared mode
- Scaling
- Keyboard menu:
diff --git a/include/default_controls.js b/include/default_controls.js
index ceb374b..071ac51 100644
--- a/include/default_controls.js
+++ b/include/default_controls.js
@@ -49,6 +49,8 @@ load: function(target) {
html += ' type="checkbox" checked> True Color</li>';
html += ' <li><input id="VNC_cursor"';
html += ' type="checkbox"> Local Cursor</li>';
+ html += ' <li><input id="VNC_shared"';
+ html += ' type="checkbox"> Shared Mode</li>';
html += ' <li><input id="VNC_connectTimeout"';
html += ' type="input"> Connect Timeout (s)</li>';
html += ' <hr>';
@@ -115,6 +117,7 @@ load: function(target) {
DC.initSetting('encrypt', false);
DC.initSetting('true_color', true);
DC.initSetting('cursor', false);
+ DC.initSetting('shared', true);
DC.initSetting('connectTimeout', 2);
DC.rfb = RFB({'target': 'VNC_canvas',
@@ -218,6 +221,7 @@ clickSettingsMenu: function() {
DC.updateSetting('cursor', false);
$('VNC_cursor').disabled = true;
}
+ DC.updateSetting('shared');
DC.updateSetting('connectTimeout');
DC.updateSetting('stylesheet');
DC.updateSetting('logging');
@@ -249,6 +253,7 @@ settingsDisabled: function(disabled, rfb) {
DefaultControls.updateSetting('cursor', false);
$('VNC_cursor').disabled = true;
}
+ $('VNC_shared').disabled = disabled;
$('VNC_connectTimeout').disabled = disabled;
//Util.Debug("<< settingsDisabled");
},
@@ -262,6 +267,7 @@ settingsApply: function() {
if (DC.rfb.get_canvas().get_cursor_uri()) {
DC.saveSetting('cursor');
}
+ DC.saveSetting('shared');
DC.saveSetting('connectTimeout');
DC.saveSetting('stylesheet');
DC.saveSetting('logging');
@@ -363,6 +369,7 @@ connect: function() {
DC.rfb.set_encrypt(DC.getSetting('encrypt'));
DC.rfb.set_true_color(DC.getSetting('true_color'));
DC.rfb.set_local_cursor(DC.getSetting('cursor'));
+ DC.rfb.set_shared(DC.getSetting('shared'));
DC.rfb.set_connectTimeout(DC.getSetting('connectTimeout'));
DC.rfb.connect(host, port, password);
diff --git a/include/rfb.js b/include/rfb.js
index 5a2fd13..10b4de8 100644
--- a/include/rfb.js
+++ b/include/rfb.js
@@ -39,7 +39,6 @@ var that = {}, // Public API interface
rfb_version = 0,
rfb_max_version= 3.8,
rfb_auth_scheme= '',
- rfb_shared = 1,
// In preference order
@@ -134,6 +133,7 @@ cdef('focusContainer', 'dom', document, 'Area that traps keyboard input');
cdef('encrypt', 'bool', false, 'Use TLS/SSL/wss encryption');
cdef('true_color', 'bool', true, 'Request true color pixel data');
cdef('local_cursor', 'bool', false, 'Request locally rendered cursor');
+cdef('shared', 'bool', true, 'Request shared mode');
cdef('connectTimeout', 'int', 2, 'Time (s) to wait for connection');
cdef('disconnectTimeout', 'int', 3, 'Time (s) to wait for disconnection');
@@ -826,7 +826,7 @@ init_msg = function() {
case 2: // too-many
return fail("Too many auth attempts");
}
- send_array([rfb_shared]); // ClientInitialisation
+ send_array([conf.shared ? 1 : 0]); // ClientInitialisation
break;
case 'ServerInitialisation' :
diff --git a/vnc_auto.html b/vnc_auto.html
index 9481017..1ba90a4 100644
--- a/vnc_auto.html
+++ b/vnc_auto.html
@@ -101,9 +101,10 @@
}
rfb = new RFB({'encrypt': WebUtil.getQueryVar('encrypt', false),
- 'true_color': WebUtil.getQueryVar('true_color', true),
- 'local_cursor': WebUtil.getQueryVar('cursor', true),
- 'updateState': updateState});
+ 'true_color': WebUtil.getQueryVar('true_color', true),
+ 'local_cursor': WebUtil.getQueryVar('cursor', true),
+ 'shared': WebUtil.getQueryVar('shared', true),
+ 'updateState': updateState});
rfb.connect(host, port, password);
};
</script>