This commit is contained in:
Tommy Tang 2017-09-12 10:02:59 +00:00 committed by GitHub
commit 229c971e9e
4 changed files with 33 additions and 1 deletions

16
Dockerfile Executable file
View File

@ -0,0 +1,16 @@
FROM python
ENV VER=${VER:-master} \
REPO=https://github.com/twhtanghk/noVNC \
APP=/usr/src/app
RUN apt-get update \
&& apt-get install -y git net-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& pip install numpy \
&& git clone -b $VER $REPO $APP
WORKDIR $APP
EXPOSE 6080

View File

@ -91,6 +91,10 @@ WebSockets to TCP socket proxy. There is a python proxy included
### Quick Start ### Quick Start
* download docker-compose.yml and customize server:port parameter
* docker-compose -f docker-compose.yml up
* Use the launch script to start a mini-webserver and the WebSockets proxy * Use the launch script to start a mini-webserver and the WebSockets proxy
(websockify). The `--vnc` option is used to specify the location of a running (websockify). The `--vnc` option is used to specify the location of a running
VNC server: VNC server:

View File

@ -392,7 +392,10 @@ RFB.prototype = {
uri = this._encrypt ? 'wss' : 'ws'; uri = this._encrypt ? 'wss' : 'ws';
} }
uri += '://' + this._rfb_host + ':' + this._rfb_port + '/' + this._rfb_path; var relpath = location.pathname.split('/');
relpath[relpath.length - 1] = "";
relpath = relpath.join("/");
uri += '://' + this._rfb_host + ':' + this._rfb_port + relpath + this._rfb_path;
Log.Info("connecting to " + uri); Log.Info("connecting to " + uri);
try { try {

9
docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
version: '2'
services:
novnc:
image: twhtanghk/novnc
ports:
- 6080
env_file:
- ../.env
command: /usr/src/app/utils/launch.sh --vnc server:port