-
Notifications
You must be signed in to change notification settings - Fork 123
Document a high level technical overview on how this project work #100
Description
I think all projects benefit greatly from a technical overview as that allows anyone to better onboard and for example debug issues or contribute to maintenance in various ways.
Here are some notes that I've distilled from learning how this project works in order to help me debug and maintain things in this project. They should absolutely be refined further, but this is similar to the level of overview I think we should provide in the README, for example under a "How it works" heading like for jupyterhub-idle-culler.
jupyter_server_proxy server entrypoints
-
/desktop-websockify/
Requests here are listened to by websockify. It terminates websocket traffic and proxies data to a VNC server.
setup_websockifyreturns a command to startwebsockify, that in turn wraps startup of a vncserver, that in turn wraps startup of a desktop session via a passedxstartupscript. Whenwebsockifywraps the startup of a vncserver, it intercepts the socket bind request to hijack listening on that port, and instead lets the vncserver listen to some other port it then will forward traffic to.The purpose of
websockifyis to bridge websocket traffic into a normal socket traffic.At the most basic level, websockify just translates WebSockets traffic to normal socket traffic. Websockify accepts the WebSockets handshake, parses it, and then begins forwarding traffic between the client and the target in both directions.
The associated JupyterLab launcher entry redirects users to /desktop/, which in turn provides an index.html referencing a viewer.js that interacts via websockets with /desktop-websockify/.
The way jupyter-server-proxy proxies communication can be either via a unix socket or via a TCP port. Only TigerVNC supports listening to unix sockets though.
bundled file
- xstartup is a simple sh executable that starts desktop stuff, it needs
to be referenced when launching the VNC server. ~/.vnc/xstartup can be
provided as an alternative
jupyter_server extension
- serves /desktop, redirects to /desktop/
- serves /desktop/static/
- cliboard.svg
- jupyter-logo.svg
- dist/viewer.js (built, depends on novnc)
- dist/index.css (built)
- serves /desktop/
- index.html (rendered from index.html template with a base_url)