From 3ec6e9219968a2a619bd9cecaecd602857010bd5 Mon Sep 17 00:00:00 2001 From: Roy Dragseth Date: Wed, 26 Jun 2024 09:21:55 +0200 Subject: [PATCH 1/4] Update examples.md A little test example to make it clear how to test the setup and where to put the config. --- docs/source/examples.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/source/examples.md b/docs/source/examples.md index fe0cf502..d9182162 100644 --- a/docs/source/examples.md +++ b/docs/source/examples.md @@ -12,3 +12,17 @@ projects on GitHub, such as: Projects can also add the `jupyter-server-proxy` topic to the GitHub repository to make it more discoverable: [https://github.com/topics/jupyter-server-proxy](https://github.com/topics/jupyter-server-proxy) + +# Test the proxy setup + +If you just want to test if the proxy config is correct you can put the following into `$HOME/.jupyter/jupyter_server_config.py`: +``` +c.ServerProxy.servers.update({ + "pythonweb": { + "command": ["/usr/local/anaconda/bin/python", "-m", "http.server", "{port}"], + "port": 9081, + "absolute_url": False + } +}) +``` +You shauld then get a new button in the launcher. Putting it into `/etc/jupyter` will make it available to all users. From 90897af3cbdddaa39b7a48396b404dbaec805f5b Mon Sep 17 00:00:00 2001 From: Roy Dragseth Date: Wed, 26 Jun 2024 09:27:29 +0200 Subject: [PATCH 2/4] Update examples.md typos --- docs/source/examples.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/examples.md b/docs/source/examples.md index d9182162..5a378e7f 100644 --- a/docs/source/examples.md +++ b/docs/source/examples.md @@ -16,7 +16,7 @@ Projects can also add the `jupyter-server-proxy` topic to the GitHub repository # Test the proxy setup If you just want to test if the proxy config is correct you can put the following into `$HOME/.jupyter/jupyter_server_config.py`: -``` +```python c.ServerProxy.servers.update({ "pythonweb": { "command": ["/usr/local/anaconda/bin/python", "-m", "http.server", "{port}"], @@ -25,4 +25,4 @@ c.ServerProxy.servers.update({ } }) ``` -You shauld then get a new button in the launcher. Putting it into `/etc/jupyter` will make it available to all users. +You should then get a new button in the launcher. Putting it into `/etc/jupyter` will make it available to all users. From 74a859291da5ab60f32287ca27b906e904d486cc Mon Sep 17 00:00:00 2001 From: Roy Dragseth Date: Wed, 26 Jun 2024 09:29:17 +0200 Subject: [PATCH 3/4] Update examples.md typo --- docs/source/examples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/examples.md b/docs/source/examples.md index 5a378e7f..0d4a775d 100644 --- a/docs/source/examples.md +++ b/docs/source/examples.md @@ -25,4 +25,4 @@ c.ServerProxy.servers.update({ } }) ``` -You should then get a new button in the launcher. Putting it into `/etc/jupyter` will make it available to all users. +You should then get a new button in the launcher. Putting it into `/etc/jupyter/` will make it available to all users. From 81f5fd535acf45a27fd42728544342cd928dc12a Mon Sep 17 00:00:00 2001 From: Roy Dragseth Date: Thu, 25 Jul 2024 10:09:12 +0200 Subject: [PATCH 4/4] Update examples.md to make the test examlpe more generic. replaced the hardwired path to the python interpreter with the more generic sys.executable that should work on all platforms. --- docs/source/examples.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/examples.md b/docs/source/examples.md index 0d4a775d..0907fd78 100644 --- a/docs/source/examples.md +++ b/docs/source/examples.md @@ -17,9 +17,10 @@ Projects can also add the `jupyter-server-proxy` topic to the GitHub repository If you just want to test if the proxy config is correct you can put the following into `$HOME/.jupyter/jupyter_server_config.py`: ```python +import sys c.ServerProxy.servers.update({ "pythonweb": { - "command": ["/usr/local/anaconda/bin/python", "-m", "http.server", "{port}"], + "command": [sys.executable, "-m", "http.server", "{port}"], "port": 9081, "absolute_url": False }