2015-12-20 07:17:27 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e -u
|
|
|
|
|
|
|
|
function die { echo $1; exit 42; }
|
|
|
|
|
|
|
|
HTTP_PORT=8000
|
|
|
|
WEBSOCKET_PORT=9000
|
|
|
|
|
|
|
|
case $# in
|
|
|
|
0) ;;
|
|
|
|
1) HTTP_PORT=$1
|
|
|
|
;;
|
|
|
|
2) WEBSOCKET_PORT=$2
|
|
|
|
;;
|
|
|
|
*) die "Usage: $0 <HTTP Server Port> <WebSocket Port>"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
cd $(dirname $0)
|
|
|
|
trap 'kill $(jobs -p)' EXIT
|
|
|
|
|
2016-01-21 12:18:17 +08:00
|
|
|
cat <<EOF
|
|
|
|
|
2017-04-28 18:05:12 +08:00
|
|
|
Starting the HTTP TLS server on port $HTTP_PORT
|
|
|
|
and the Secure WebSocket server on port $WEBSOCKET_PORT.
|
2016-01-21 12:18:17 +08:00
|
|
|
|
|
|
|
Access the demo through the HTTP server in your browser.
|
2017-04-28 18:05:12 +08:00
|
|
|
If you're running on the same computer outside of Docker, use https://localhost:$HTTP_PORT
|
2016-01-21 12:18:17 +08:00
|
|
|
If you're running on the same computer with Docker, find the IP
|
2017-04-28 18:05:12 +08:00
|
|
|
address of the Docker container and use https://<docker-ip>:$HTTP_PORT.
|
2016-01-21 12:18:17 +08:00
|
|
|
If you're running on a remote computer, find the IP address
|
2017-04-28 18:05:12 +08:00
|
|
|
and use https://<remote-ip>:$HTTP_PORT.
|
2016-01-21 12:18:17 +08:00
|
|
|
|
2017-04-28 18:05:12 +08:00
|
|
|
WARNING: Chromium will warn on self-signed certificates. Please accept the certificate
|
|
|
|
and reload the app.
|
2016-01-21 12:18:17 +08:00
|
|
|
|
|
|
|
EOF
|
2015-12-20 07:17:27 +08:00
|
|
|
|
|
|
|
WEBSOCKET_LOG='/tmp/openface.websocket.log'
|
|
|
|
printf "WebSocket Server: Logging to '%s'\n\n" $WEBSOCKET_LOG
|
|
|
|
|
2017-04-28 18:05:12 +08:00
|
|
|
python2 simpleSSLServer.py $HTTP_PORT &> /dev/null &
|
2015-12-20 07:17:27 +08:00
|
|
|
|
|
|
|
cd ../../ # Root OpenFace directory.
|
|
|
|
./demos/web/websocket-server.py --port $WEBSOCKET_PORT 2>&1 | tee $WEBSOCKET_LOG &
|
|
|
|
|
|
|
|
wait
|