# Jupyter-server-proxy url parameter

**URL:** <https://discourse.jupyter.org/t/jupyter-server-proxy-url-parameter/13642>\
**Category:** JupyterHub\
**Created:** [March 29, 2022, 9:09am UTC](https://discourse.jupyter.org/t/jupyter-server-proxy-url-parameter/13642 "2022-03-29T09:09:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![djangoliv](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/djangoliv/32/5329_2.png) [@djangoliv](https://discourse.jupyter.org/u/djangoliv)\
**Post date:** [March 29, 2022, 9:09am UTC](https://discourse.jupyter.org/t/jupyter-server-proxy-url-parameter/13642/1 "2022-03-29T09:09:35Z")

</div>

I created a package to run streamlit on a python file on jupyterhub.

`https://gitlab.com/logilab/jupyterlab-streamlit-server/-/blob/master/jupyter_streamlit_server/ __init__.py`

It works, if a go to `https://{base_url}/jupyter_streamlit_server` I can see the result.

The problem is that the python file is hardcoded (app/index.py).

Is there a solution to pass the path of the file in the url?

I would like to go to `https://{base_url}/jupyter_streamlit_server/myfile.py` run the command `streamlit run myfile.py`

Regards

---

<div class="post-metadata">

**Author:** ![bollwyvl](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bollwyvl/32/904_2.png) [@bollwyvl](https://discourse.jupyter.org/u/bollwyvl)\
**Post date:** [March 29, 2022, 1:04pm UTC](https://discourse.jupyter.org/t/jupyter-server-proxy-url-parameter/13642/2 "2022-03-29T13:04:28Z")

</div>

It may not be strictly possible to do this within configuration.

If streamlit doesn’t support dynamically dispatching to multiple apps on the same port, you’ll probably have to implement your own mechanism.

Still in `jupyter-server-proxy`, you could write a simple “server” that just starts _another_ server, per file, on a new port, and serves a one-line redirect HTML to `{base_url}/proxy/{new_port}`. No idea how you’d clean them up, though!

The weirdest thing might be to run streamlit _inside_ the `jupyter_server`: it looks like `streamlit` uses `tornado` under the hood: you could probably figure out some way to use the “guts” of it more directly, and implement multiple app endpoints yourself, as a `serverextension`, where they [share the same app](https://blog.dask.org/2019/09/13/jupyter-on-dask)… but this is kinda crazy.

---

<div class="post-metadata">

**Author:** ![djangoliv](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/djangoliv/32/5329_2.png) [@djangoliv](https://discourse.jupyter.org/u/djangoliv)\
**Post date:** [March 29, 2022, 1:26pm UTC](https://discourse.jupyter.org/t/jupyter-server-proxy-url-parameter/13642/3 "2022-03-29T13:26:33Z")

</div>

> [@bollwyvl](#):
>
> It may not be strictly possible to do this within configuration.
> 
> If streamlit doesn’t support dynamically dispatching to multiple apps on the same port, you’ll probably have to implement your own mechanism.
> 
> Still in `jupyter-server-proxy` , you could write a simple “server” that just starts _another_ server, per file, on a new port, and serves a one-line redirect HTML to `{base_url}/proxy/{new_port}` . No idea how you’d clean them up, though!
> 
> The weirdest thing might be to run streamlit _inside_ the `jupyter_server` : it looks like `streamlit` uses `tornado` under the hood: you could probably figure out some way to use the “guts” of it more directly, and implement multiple app endpoints yourself, as a `serverextension` , where they [share the same app](https://blog.dask.org/2019/09/13/jupyter-on-dask)… but this is kinda crazy.

Thank you for your answer @bollwyvl even if it does not suit me 🙂 . I will continue to search for a solution.
