Commit 2090f1af authored by Joel Martin's avatar Joel Martin

Merge remote branch 'kassah/master'

parents 9450f132 9ebc84f2
......@@ -134,6 +134,7 @@ Util.conf_defaults(conf, that, defaults, [
['focusContainer', 'wo', 'dom', document, 'DOM element that captures keyboard input'],
['encrypt', 'rw', 'bool', false, 'Use TLS/SSL/wss encryption'],
['repeaterID', 'rw', 'string', '', 'RepeaterID to connect to'],
['true_color', 'rw', 'bool', true, 'Request true color pixel data'],
['local_cursor', 'rw', 'bool', false, 'Request locally rendered cursor'],
['shared', 'rw', 'bool', true, 'Request shared mode'],
......@@ -659,10 +660,10 @@ mouseMove = function(x, y) {
init_msg = function() {
//Util.Debug(">> init_msg [rfb_state '" + rfb_state + "']");
var strlen, reason, length, sversion, cversion,
var strlen, reason, length, sversion, cversion, repeaterID,
i, types, num_types, challenge, response, bpp, depth,
big_endian, red_max, green_max, blue_max, red_shift,
green_shift, blue_shift, true_color, name_length;
green_shift, blue_shift, true_color, name_length, is_repeater;
//Util.Debug("ws.rQ (" + ws.rQlen() + ") " + ws.rQslice(0));
switch (rfb_state) {
......@@ -673,7 +674,9 @@ init_msg = function() {
}
sversion = ws.rQshiftStr(12).substr(4,7);
Util.Info("Server ProtocolVersion: " + sversion);
is_repeater = 0;
switch (sversion) {
case "000.000": is_repeater = 1; break; // UltraVNC repeater
case "003.003": rfb_version = 3.3; break;
case "003.006": rfb_version = 3.3; break; // UltraVNC
case "003.889": rfb_version = 3.3; break; // Apple Remote Desktop
......@@ -684,6 +687,13 @@ init_msg = function() {
default:
return fail("Invalid server version " + sversion);
}
if (is_repeater) {
repeaterID = conf.repeaterID;
while(repeaterID.length < 250)
repeaterID += "\0";
ws.send_string(repeaterID);
break;
}
if (rfb_version > rfb_max_version) {
rfb_version = rfb_max_version;
}
......@@ -730,6 +740,7 @@ init_msg = function() {
// Server decides
if (ws.rQwait("security scheme", 4)) { return false; }
rfb_auth_scheme = ws.rQshift32();
//rfb_auth_scheme = ws.rQshiftStr(12);
}
updateState('Authentication',
"Authenticating using scheme: " + rfb_auth_scheme);
......
......@@ -49,6 +49,7 @@ load: function() {
UI.initSetting('port', window.location.port);
UI.initSetting('password', '');
UI.initSetting('encrypt', (window.location.protocol === "https:"));
UI.initSetting('repeaterID', '');
UI.initSetting('true_color', true);
UI.initSetting('cursor', false);
UI.initSetting('shared', true);
......@@ -258,6 +259,7 @@ toggleSettingsPanel: function() {
UI.closeSettingsMenu();
} else {
UI.updateSetting('encrypt');
UI.updateSetting('repeaterID');
UI.updateSetting('true_color');
if (UI.rfb.get_display().get_cursor_uri()) {
UI.updateSetting('cursor');
......@@ -304,6 +306,7 @@ closeSettingsMenu: function() {
settingsApply: function() {
//Util.Debug(">> settingsApply");
UI.saveSetting('encrypt');
UI.saveSetting('repeaterID');
UI.saveSetting('true_color');
if (UI.rfb.get_display().get_cursor_uri()) {
UI.saveSetting('cursor');
......@@ -415,6 +418,7 @@ updateVisualState: function() {
//Util.Debug(">> updateVisualState");
$D('noVNC_encrypt').disabled = connected;
$D('noVNC_repeaterID').disabled = connected;
$D('noVNC_true_color').disabled = connected;
if (UI.rfb && UI.rfb.get_display() &&
UI.rfb.get_display().get_cursor_uri()) {
......@@ -484,6 +488,7 @@ connect: function() {
}
UI.rfb.set_encrypt(UI.getSetting('encrypt'));
UI.rfb.set_repeaterID(UI.getSetting('repeaterID'));
UI.rfb.set_true_color(UI.getSetting('true_color'));
UI.rfb.set_local_cursor(UI.getSetting('cursor'));
UI.rfb.set_shared(UI.getSetting('shared'));
......
......@@ -146,6 +146,8 @@ Util.conf_default = function(cfg, api, defaults, v, mode, type, defval, desc) {
}
} else if (type in {'integer':1, 'int':1}) {
val = parseInt(val, 10);
} else if (type === 'string') {
val = String(val);
} else if (type === 'func') {
if (!val) {
val = function () {};
......
......@@ -140,6 +140,7 @@
<li><input id="noVNC_view_only" type="checkbox"> View Only</li>
<li><input id="noVNC_connectTimeout" type="input"> Connect Timeout (s)</li>
<li><input id="noVNC_path" type="input" value="websockify"> Path</li>
<li><input id="noVNC_repeaterID" type="input" value=""> Repeater ID</li>
<hr>
<!-- Stylesheet selection dropdown -->
<li><label><strong>Style: </strong>
......
......@@ -103,6 +103,7 @@
password = WebUtil.getQueryVar('password', '');
path = WebUtil.getQueryVar('path', 'websockify');
if ((!host) || (!port)) {
updateState('failed',
"Must specify host and port in URL");
......@@ -112,6 +113,7 @@
rfb = new RFB({'target': $D('noVNC_canvas'),
'encrypt': WebUtil.getQueryVar('encrypt',
(window.location.protocol === "https:")),
'repeaterID': WebUtil.getQueryVar('repeaterID', ''),
'true_color': WebUtil.getQueryVar('true_color', true),
'local_cursor': WebUtil.getQueryVar('cursor', true),
'shared': WebUtil.getQueryVar('shared', true),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment