Skip to content

Commit 00d0801

Browse files
committed
Access TurboVNC via a unix socket instead of a port
This requires TurboVNC 3.1.0 and is due to this a breaking change worth highlighting in a major release.
1 parent 9fa0cce commit 00d0801

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: |
5656
# -help flag is not available for TurboVNC, but it emits the -help
5757
# equivalent information anyhow if passed -help, but also errors. Due
58-
# to this, we fallback to use the errorcode of vncsrever -list.
58+
# to this, we fallback to use the errorcode of vncserver -list.
5959
docker run test bash -c "vncserver -help || vncserver -list > /dev/null"
6060
6161
- name: Test vncserver

jupyter_remote_desktop_proxy/setup_websockify.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,8 @@ def setup_websockify():
1212
"vncserver executable not found, please install a VNC server"
1313
)
1414

15-
# TurboVNC and TigerVNC share the same origin and both use a Perl script
16-
# as the executable vncserver. We can determine if vncserver is TigerVNC
17-
# by searching tigervnc string in the Perl script.
18-
#
19-
# The content of the vncserver executable can differ depending on how
20-
# TigerVNC and TurboVNC has been distributed. Below are files known to be
21-
# read in some situations:
22-
#
23-
# - https://github.com/TigerVNC/tigervnc/blob/v1.13.1/unix/vncserver/vncserver.in
24-
# - https://github.com/TurboVNC/turbovnc/blob/3.1.1/unix/vncserver.in
25-
#
26-
with open(vncserver) as vncserver_file:
27-
is_tigervnc = "tigervnc" in vncserver_file.read().casefold()
28-
29-
if is_tigervnc:
30-
unix_socket = True
31-
vnc_args = [vncserver, '-rfbunixpath', "{unix_socket}"]
32-
else:
33-
unix_socket = False
34-
vnc_args = [vncserver, '-localhost', '-rfbport', '{port}']
15+
# {unix_socket} is expanded by jupyter-server-proxy
16+
vnc_args = [vncserver, '-rfbunixpath', '{unix_socket}']
3517

3618
xstartup = os.getenv("JUPYTER_REMOTE_DESKTOP_PROXY_XSTARTUP")
3719
if not xstartup and not os.path.exists(os.path.expanduser('~/.vnc/xstartup')):
@@ -59,6 +41,6 @@ def setup_websockify():
5941
# /desktop/ is the user facing URL, while /desktop-websockify/ now *only* serves
6042
# websockets.
6143
"launcher_entry": {"title": "Desktop", "path_info": "desktop"},
62-
"unix_socket": unix_socket,
44+
"unix_socket": True,
6345
"raw_socket_proxy": True,
6446
}

0 commit comments

Comments
 (0)