diff options
author | Pierre Ossman <ossman@cendio.se> | 2017-02-03 16:25:15 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2017-02-03 16:59:54 +0100 |
commit | 3f8f301d7fb0c137a02eb6dfb2e20f80a4c05836 (patch) | |
tree | 4f05d3c6f0065e2ae63c9a9121499d9971878b40 /tests | |
parent | 10e13d7a7e679360a2cb2bc22cd2b0d964c5acb6 (diff) | |
download | websockify-3f8f301d7fb0c137a02eb6dfb2e20f80a4c05836.tar.gz |
Update websock.js from noVNC
Sync with noVNC as of commit ae510306b5094b55aa08a2a0d15a151704f70993.
The main change is to make it a more proper object that you can
instantiate multiple times.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/latency.html | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/latency.html b/tests/latency.html index a25019c..1c42653 100644 --- a/tests/latency.html +++ b/tests/latency.html @@ -91,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 '^'"); @@ -104,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]; |