|
| 1 | +# Jupyter Server Proxy |
| 2 | + |
| 3 | +[](https://jupyter-server-proxy.readthedocs.io/) |
| 4 | +[](https://github.com/jupyterhub/jupyter-server-proxy/actions) |
| 5 | +[](https://pypi.python.org/pypi/jupyter-server-proxy) |
| 6 | +[](https://anaconda.org/conda-forge/jupyter-server-proxy) |
| 7 | +[](https://www.npmjs.com/package/@jupyterlab/server-proxy) |
| 8 | + |
| 9 | +Jupyter Server Proxy lets you run arbitrary external processes (such as |
| 10 | +RStudio, Shiny Server, Syncthing, PostgreSQL, Code Server, etc) |
| 11 | +alongside your notebook server and provide authenticated web access to |
| 12 | +them using a path like `/rstudio` next to others like `/lab`. Alongside |
| 13 | +the python package that provides the main functionality, the JupyterLab |
| 14 | +extension (`@jupyterlab/server-proxy`) provides buttons in the |
| 15 | +JupyterLab launcher window to get to RStudio for example. |
| 16 | + |
| 17 | +**Note:** This project used to be called **nbserverproxy**. As |
| 18 | +nbserverproxy is an older version of jupyter-server-proxy, uninstall |
| 19 | +nbserverproxy before installing jupyter-server-proxy to avoid conflicts. |
| 20 | + |
| 21 | +The primary use cases are: |
| 22 | + |
| 23 | +1. Use with JupyterHub / Binder to allow launching users into web |
| 24 | + interfaces that have nothing to do with Jupyter - such as RStudio, |
| 25 | + Shiny, or OpenRefine. |
| 26 | +2. Allow access from frontend javascript (in classic notebook or |
| 27 | + JupyterLab extensions) to access web APIs of other processes running |
| 28 | + locally in a safe manner. This is used by the [JupyterLab |
| 29 | + extension](https://github.com/dask/dask-labextension) for |
| 30 | + [dask](https://dask.org/). |
| 31 | + |
| 32 | +[The documentation](https://jupyter-server-proxy.readthedocs.io/) |
| 33 | +contains information on installation & usage. |
| 34 | + |
| 35 | +## Install |
| 36 | + |
| 37 | +### Python package |
| 38 | + |
| 39 | +#### pip |
| 40 | + |
| 41 | +``` |
| 42 | +pip install jupyter-server-proxy |
| 43 | +``` |
| 44 | + |
| 45 | +#### conda |
| 46 | + |
| 47 | +``` |
| 48 | +conda install jupyter-server-proxy -c conda-forge |
| 49 | +``` |
| 50 | + |
| 51 | +### JupyterLab extension |
| 52 | + |
| 53 | +Note that as the JupyterLab extension only is a graphical interface to |
| 54 | +launch registered applications in the python package, the extension |
| 55 | +requires the python package to be installed. |
| 56 | + |
| 57 | +``` |
| 58 | +jupyter labextension install @jupyterlab/server-proxy |
| 59 | +``` |
| 60 | + |
| 61 | +## Contributing |
| 62 | + |
| 63 | +### Python package |
| 64 | + |
| 65 | +``` |
| 66 | +pip install -e . |
| 67 | +
|
| 68 | +# explicit install needed with editable mode (-e) jupyter |
| 69 | +jupyter serverextension enable --sys-prefix jupyter_server_proxy |
| 70 | +``` |
| 71 | + |
| 72 | +### JupyterLab extension |
| 73 | + |
| 74 | +The `jlpm` command is JupyterLab's pinned version of `yarn` that is |
| 75 | +installed with JupyterLab. You may use `yarn` or `npm` instead of `jlpm` |
| 76 | +below. |
| 77 | + |
| 78 | +``` |
| 79 | +cd jupyterlab-server-proxy |
| 80 | +
|
| 81 | +# Install dependencies |
| 82 | +jlpm |
| 83 | +
|
| 84 | +# Build Typescript source |
| 85 | +jlpm build |
| 86 | +
|
| 87 | +# Link your development version of the extension with JupyterLab |
| 88 | +jupyter labextension link . |
| 89 | +
|
| 90 | +# Rebuild Typescript source after making changes |
| 91 | +jlpm build |
| 92 | +
|
| 93 | +# Rebuild JupyterLab after making any changes |
| 94 | +jupyter lab build |
| 95 | +``` |
| 96 | + |
| 97 | +You can watch the source directory and run JupyterLab in watch mode to |
| 98 | +watch for changes in the extension's source and automatically rebuild |
| 99 | +the extension and application. |
| 100 | + |
| 101 | +``` |
| 102 | +# Watch the source directory in another terminal tab |
| 103 | +jlpm watch |
| 104 | +
|
| 105 | +# Run jupyterlab in watch mode in one terminal tab |
| 106 | +jupyter lab --watch |
| 107 | +``` |
0 commit comments