websockify: better multi-python version support.
Pull from websockify: 008a5118e728. Should address issue https://github.com/kanaka/noVNC/issues/107 - Also add ability to force use of web-socket-js using window.WEB_SOCKET_FORCE_FLASH - in websock.js, for rQshift*, assume length is the full length if not specified.
This commit is contained in:
+4
-2
@@ -17,9 +17,9 @@
|
||||
|
||||
// Load Flash WebSocket emulator if needed
|
||||
|
||||
if (window.WebSocket) {
|
||||
if (window.WebSocket && !window.WEB_SOCKET_FORCE_FLASH) {
|
||||
Websock_native = true;
|
||||
} else if (window.MozWebSocket) {
|
||||
} else if (window.MozWebSocket && !window.WEB_SOCKET_FORCE_FLASH) {
|
||||
Websock_native = true;
|
||||
window.WebSocket = window.MozWebSocket;
|
||||
} else {
|
||||
@@ -119,6 +119,7 @@ function rQshift32() {
|
||||
(rQ[rQi++] );
|
||||
}
|
||||
function rQshiftStr(len) {
|
||||
if (typeof(len) === 'undefined') { len = rQlen(); }
|
||||
var arr = rQ.slice(rQi, rQi + len);
|
||||
rQi += len;
|
||||
return arr.map(function (num) {
|
||||
@@ -126,6 +127,7 @@ function rQshiftStr(len) {
|
||||
|
||||
}
|
||||
function rQshiftBytes(len) {
|
||||
if (typeof(len) === 'undefined') { len = rQlen(); }
|
||||
rQi += len;
|
||||
return rQ.slice(rQi-len, rQi);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user