From 477947ba96a00032ae35ac55fd02a4a5f485497e Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Mon, 15 Apr 2013 12:22:08 -0500 Subject: [PATCH] Remove wsproxy references. Sync launch.sh from noVNC. --- other/launch.sh | 18 ++++++++++++++---- other/websocket.c | 2 +- rebind.c | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/other/launch.sh b/other/launch.sh index 613250c..1581f17 100755 --- a/other/launch.sh +++ b/other/launch.sh @@ -16,6 +16,8 @@ usage() { echo " Default: localhost:5900" echo " --cert CERT Path to combined cert/key file" echo " Default: self.pem" + echo " --web WEB Path to web files (e.g. vnc.html)" + echo " Default: ./" exit 2 } @@ -24,6 +26,7 @@ HERE="$(cd "$(dirname "$0")" && pwd)" PORT="6080" VNC_DEST="localhost:5900" CERT="" +WEB="" proxy_pid="" die() { @@ -50,6 +53,7 @@ while [ "$*" ]; do --listen) PORT="${OPTARG}"; shift ;; --vnc) VNC_DEST="${OPTARG}"; shift ;; --cert) CERT="${OPTARG}"; shift ;; + --web) WEB="${OPTARG}"; shift ;; -h|--help) usage ;; -*) usage "Unknown chrooter option: ${param}" ;; *) break ;; @@ -60,18 +64,24 @@ done which netstat >/dev/null 2>&1 \ || die "Must have netstat installed" -netstat -ltn | grep -qs "${PORT}.*LISTEN" \ +netstat -ltn | grep -qs "${PORT} .*LISTEN" \ && die "Port ${PORT} in use. Try --listen PORT" trap "cleanup" TERM QUIT INT EXIT # Find vnc.html -if [ -e "$(pwd)/vnc.html" ]; then +if [ -n "${WEB}" ]; then + if [ ! -e "${WEB}/vnc.html" ]; then + die "Could not find ${WEB}/vnc.html" + fi +elif [ -e "$(pwd)/vnc.html" ]; then WEB=$(pwd) elif [ -e "${HERE}/../vnc.html" ]; then WEB=${HERE}/../ elif [ -e "${HERE}/vnc.html" ]; then WEB=${HERE} +elif [ -e "${HERE}/../share/novnc/vnc.html" ]; then + WEB=${HERE}/../share/novnc/ else die "Could not find vnc.html" fi @@ -92,7 +102,7 @@ else fi echo "Starting webserver and WebSockets proxy on port ${PORT}" -${HERE}/wsproxy.py --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} & +${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} & proxy_pid="$!" sleep 1 if ! ps -p ${proxy_pid} >/dev/null; then @@ -101,7 +111,7 @@ if ! ps -p ${proxy_pid} >/dev/null; then exit 1 fi -echo -e "\n\nNavigate to to this URL:\n" +echo -e "\n\nNavigate to this URL:\n" echo -e " http://$(hostname):${PORT}/vnc.html?host=$(hostname)&port=${PORT}\n" echo -e "Press Ctrl-C to exit\n\n" diff --git a/other/websocket.c b/other/websocket.c index c365409..9755711 100644 --- a/other/websocket.c +++ b/other/websocket.c @@ -795,7 +795,7 @@ void start_server() { } handler_msg("handler exit\n"); } else { - handler_msg("wsproxy exit\n"); + handler_msg("websockify exit\n"); } } diff --git a/rebind.c b/rebind.c index d7b004d..811031c 100644 --- a/rebind.c +++ b/rebind.c @@ -7,8 +7,8 @@ * REBIND_PORT_NEW environment variables are set then bind on the new * port (of localhost) instead of the old port. * - * This allows a proxy (such as wsproxy) to run on the old port and translate - * traffic to/from the new port. + * This allows a bridge/proxy (such as websockify) to run on the old port and + * translate traffic to/from the new port. * * Usage: * LD_PRELOAD=./rebind.so \