Skip to content

Commit 40557b2

Browse files
committed
Remove websockify
jupyter-server-proxy 4.3.0 includes jupyterhub/jupyter-server-proxy#447
1 parent b4e88e9 commit 40557b2

File tree

4 files changed

+10
-33
lines changed

4 files changed

+10
-33
lines changed

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ For an example, see the [`Dockerfile`](./Dockerfile) in this repository which in
3131
pip install jupyter-remote-desktop-proxy
3232
```
3333

34-
2. Install the [websockify](https://github.com/novnc/websockify) dependency. Unfortunately,
35-
the PyPI `websockify` package is broken, so you need to install it either
36-
from [conda-forge](https://anaconda.org/conda-forge/websockify) or with
37-
[apt](https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=websockify)
38-
39-
3. Install the packages needed to provide a VNC server and the actual Linux Desktop environment.
34+
2. Install the packages needed to provide a VNC server and the actual Linux Desktop environment.
4035
You need to pick a desktop environment (there are many!) - here are the packages
4136
to use TigerVNC and the light-weight [XFCE4](https://www.xfce.org/) desktop environment on Ubuntu 22.04:
4237

environment.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
# Unfortunately the version of websockify on PyPI doesn't include the [compiled
2-
# wrapper library](https://github.com/novnc/websockify#wrap-a-program) which is
3-
# used by this extension, so either you'd have to manually compile it after pip
4-
# installing websockify, or use the conda package.
5-
#
61
channels:
72
- conda-forge
83
dependencies:
9-
- jupyter-server-proxy>=1.4
4+
- jupyter-server-proxy>=4.3.0
105
- jupyterhub-singleuser
116
- pip
7+
# TODO: remove when test.yaml is updated
128
- websockify

jupyter_remote_desktop_proxy/setup_websockify.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import shlex
3-
import tempfile
43
from shutil import which
54

65
HERE = os.path.dirname(os.path.abspath(__file__))
@@ -12,8 +11,6 @@ def setup_websockify():
1211
raise RuntimeError(
1312
"vncserver executable not found, please install a VNC server"
1413
)
15-
if not which('websockify'):
16-
raise RuntimeError("websockify executable not found, please install websockify")
1714

1815
# TurboVNC and TigerVNC share the same origin and both use a Perl script
1916
# as the executable vncserver. We can determine if vncserver is TigerVNC
@@ -30,16 +27,10 @@ def setup_websockify():
3027
is_tigervnc = "tigervnc" in vncserver_file.read().casefold()
3128

3229
if is_tigervnc:
33-
# Make a secure temporary directory for sockets that is only readable,
34-
# writeable, and searchable by our uid - TigerVNC can listen to a Unix
35-
# socket!
36-
sockets_dir = tempfile.mkdtemp()
37-
sockets_path = os.path.join(sockets_dir, 'vnc-socket')
38-
39-
websockify_args = ['--unix-target', sockets_path]
40-
vnc_args = [vncserver, '-rfbunixpath', sockets_path]
30+
unix_socket = True
31+
vnc_args = [vncserver, '-rfbunixpath', "{unix_socket}"]
4132
else:
42-
websockify_args = []
33+
unix_socket = False
4334
vnc_args = [vncserver, '-localhost', '-rfbport', '{port}']
4435

4536
if not os.path.exists(os.path.expanduser('~/.vnc/xstartup')):
@@ -58,18 +49,13 @@ def setup_websockify():
5849
)
5950

6051
return {
61-
'command': [
62-
'websockify',
63-
'--verbose',
64-
'--heartbeat=30',
65-
'{port}',
66-
]
67-
+ websockify_args
68-
+ ['--', '/bin/sh', '-c', f'cd {os.getcwd()} && {vnc_command}'],
52+
'command': ['/bin/sh', '-c', f'cd {os.getcwd()} && {vnc_command}'],
6953
'timeout': 30,
7054
'new_browser_window': True,
7155
# We want the launcher entry to point to /desktop/, not to /desktop-websockify/
7256
# /desktop/ is the user facing URL, while /desktop-websockify/ now *only* serves
7357
# websockets.
7458
"launcher_entry": {"title": "Desktop", "path_info": "desktop"},
59+
"unix_socket": unix_socket,
60+
"raw_socket_proxy": True,
7561
}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def run(self):
6464
]
6565
},
6666
install_requires=[
67-
'jupyter-server-proxy>=4.1.1',
67+
'jupyter-server-proxy>=4.3.0',
6868
],
6969
include_package_data=True,
7070
keywords=["Interactive", "Desktop", "Jupyter"],

0 commit comments

Comments
 (0)