Merge pull request #1117 from novnc/bug/fix-test-playback
Fix test playback
This commit is contained in:
commit
2c0b146630
|
@ -91,18 +91,18 @@ export default class RecordingPlayer {
|
||||||
this._trafficManagement = (trafficManagement === undefined) ? !realtime : trafficManagement;
|
this._trafficManagement = (trafficManagement === undefined) ? !realtime : trafficManagement;
|
||||||
|
|
||||||
this._running = true;
|
this._running = true;
|
||||||
|
|
||||||
this._queueNextPacket();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// _enablePlaybackMode mocks out things not required for running playback
|
// _enablePlaybackMode mocks out things not required for running playback
|
||||||
_enablePlaybackMode() {
|
_enablePlaybackMode() {
|
||||||
|
const self = this;
|
||||||
this._rfb._sock.send = () => {};
|
this._rfb._sock.send = () => {};
|
||||||
this._rfb._sock.close = () => {};
|
this._rfb._sock.close = () => {};
|
||||||
this._rfb._sock.flush = () => {};
|
this._rfb._sock.flush = () => {};
|
||||||
this._rfb._sock.open = function () {
|
this._rfb._sock.open = function () {
|
||||||
this.init();
|
this.init();
|
||||||
this._eventHandlers.open();
|
this._eventHandlers.open();
|
||||||
|
self._queueNextPacket();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,22 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>VNC Playback</title>
|
<title>VNC Playback</title>
|
||||||
<script src="/vendor/browser-es-module-loader/dist/browser-es-module-loader.js"></script>
|
<!-- promise polyfills promises for IE11 -->
|
||||||
<script type="module" src="./playback.js"></script>
|
<script src="../vendor/promise.js"></script>
|
||||||
|
<!-- ES2015/ES6 modules polyfill -->
|
||||||
|
<script type="module">
|
||||||
|
window._noVNC_has_module_support = true;
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
window.addEventListener("load", function() {
|
||||||
|
if (window._noVNC_has_module_support) return;
|
||||||
|
var loader = document.createElement("script");
|
||||||
|
loader.src = "../vendor/browser-es-module-loader/dist/browser-es-module-loader.js";
|
||||||
|
document.head.appendChild(loader);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- actual script modules -->
|
||||||
|
<script type="module" src="./playback-ui.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ usage() {
|
||||||
echo " Default: ./"
|
echo " Default: ./"
|
||||||
echo " --ssl-only Disable non-https connections."
|
echo " --ssl-only Disable non-https connections."
|
||||||
echo " "
|
echo " "
|
||||||
|
echo " --record FILE Record traffic to FILE.session.js"
|
||||||
|
echo " "
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +38,7 @@ CERT=""
|
||||||
WEB=""
|
WEB=""
|
||||||
proxy_pid=""
|
proxy_pid=""
|
||||||
SSLONLY=""
|
SSLONLY=""
|
||||||
|
RECORD_ARG=""
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
|
@ -63,6 +66,7 @@ while [ "$*" ]; do
|
||||||
--cert) CERT="${OPTARG}"; shift ;;
|
--cert) CERT="${OPTARG}"; shift ;;
|
||||||
--web) WEB="${OPTARG}"; shift ;;
|
--web) WEB="${OPTARG}"; shift ;;
|
||||||
--ssl-only) SSLONLY="--ssl-only" ;;
|
--ssl-only) SSLONLY="--ssl-only" ;;
|
||||||
|
--record) RECORD_ARG="--record ${OPTARG}"; shift ;;
|
||||||
-h|--help) usage ;;
|
-h|--help) usage ;;
|
||||||
-*) usage "Unknown chrooter option: ${param}" ;;
|
-*) usage "Unknown chrooter option: ${param}" ;;
|
||||||
*) break ;;
|
*) break ;;
|
||||||
|
@ -145,7 +149,7 @@ fi
|
||||||
|
|
||||||
echo "Starting webserver and WebSockets proxy on port ${PORT}"
|
echo "Starting webserver and WebSockets proxy on port ${PORT}"
|
||||||
#${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
|
#${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
|
||||||
${WEBSOCKIFY} ${SSLONLY} --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
|
${WEBSOCKIFY} ${SSLONLY} --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} ${RECORD_ARG} &
|
||||||
proxy_pid="$!"
|
proxy_pid="$!"
|
||||||
sleep 1
|
sleep 1
|
||||||
if ! ps -p ${proxy_pid} >/dev/null; then
|
if ! ps -p ${proxy_pid} >/dev/null; then
|
||||||
|
|
Loading…
Reference in New Issue