1
0
mirror of https://github.com/fcwu/docker-ubuntu-vnc-desktop synced 2026-08-06 08:12:40 +02:00

feat: upgrade noVNC

This commit is contained in:
Doro Wu
2017-02-25 12:55:24 +08:00
parent 394c340688
commit 0c04c5ec3b
489 changed files with 18241 additions and 54521 deletions
+9 -27
View File
@@ -2,7 +2,6 @@
<head>
<title>WebSockets Latency Test</title>
<script src="include/base64.js"></script>
<script src="include/util.js"></script>
<script src="include/webutil.js"></script>
<script src="include/websock.js"></script>
@@ -57,7 +56,7 @@
<script>
var host = null, port = null, sendDelay = 0, actualSendDelay,
var host = null, port = null, sendDelay = 0,
ws = null, send_ref = null,
sent, received, latencies, ltotal, laverage, lrunning, lmin, lmax,
run_length = 40,
@@ -92,8 +91,8 @@
now = (new Date()).getTime(); // Early as possible
arr = ws.rQshiftBytes(ws.rQlen());
first = String.fromCharCode(arr.shift());
last = String.fromCharCode(arr.pop());
first = String.fromCharCode(arr[0]);
last = String.fromCharCode(arr[arr.length-1]);
if (first != "^") {
message("Error: packet missing start char '^'");
@@ -105,9 +104,11 @@
disconnect();
return;
}
arr = arr.map(function(num) {
return String.fromCharCode(num);
} ).join('').split(':');
text = ''
for (var i = 1; i < arr.length-1; i++) {
text += String.fromCharCode(arr[i]);
}
arr = text.split(':');
seq = arr[0];
timestamp = parseInt(arr[1],10);
rpayload = arr[2];
@@ -152,19 +153,6 @@
function sendMsg() {
var arr = [];
if (! ws.flush() ) {
message("WebSocket not ready, backing off");
actualSendDelay = actualSendDelay * 2;
send_ref = setTimeout(sendMsg, actualSendDelay);
return false;
} else {
// Scale the delay down to the requested minimum
if (actualSendDelay > sendDelay) {
message("WebSocket ready, increasing presure");
actualSendDelay = Math.max(actualSendDelay / 2, sendDelay);
}
}
timestamp = (new Date()).getTime();
arr.pushStr("^" + send_seq + ":" + timestamp + ":" + payload + "$");
send_seq ++;
@@ -172,7 +160,7 @@
sent++;
showStats();
send_ref = setTimeout(sendMsg, actualSendDelay);
send_ref = setTimeout(sendMsg, sendDelay);
}
function showStats() {
@@ -246,7 +234,6 @@
lrunning = 0;
lmin = 999999999;
lmax = 0;
actualSendDelay = sendDelay;
$D('connectButton').value = "Stop";
$D('connectButton').onclick = disconnect;
@@ -275,11 +262,6 @@
window.onload = function() {
console.log("onload");
if (Websock_native) {
message("Using native WebSockets");
} else {
message("initializing web-socket-js flash bridge");
}
var url = document.location.href;
$D('host').value = (url.match(/host=([^&#]*)/) || ['',window.location.hostname])[1];
$D('port').value = (url.match(/port=([^&#]*)/) || ['',window.location.port])[1];