Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable websocket settings for arbitrary proxying #493

Open
Inveracity opened this issue Jul 16, 2024 · 0 comments
Open

Configurable websocket settings for arbitrary proxying #493

Inveracity opened this issue Jul 16, 2024 · 0 comments

Comments

@Inveracity
Copy link

Background

I'm facing an issue where arbitrary proxying to apps running in JupyterLab (ie. mylab.local/user/xyz/proxy/8080) hits the 10 MB websocket message size limit and kills the connection.
I found the problem was caused by the jupyter-server-proxy and by changing the code (see diff below) from using Tornados default setting to hardcoding 1000 * 1024 * 1024 resolved the limitation.

https://github.com/jupyterhub/jupyter-server-proxy/blob/main/jupyter_server_proxy/websocket.py#L52-L54

-max_message_size=getattr(
-    websocket, "_default_max_message_size", 10 * 1024 * 1024
-),
+max_message_size=1000 * 1024 * 1024,

I am now reasoning that the raw_socket_proxy setting would bypass this limitation entirely, however it does not seem obvious to me how I can tell JupyterLab to configure the jupyter-server-proxy to default to a raw_socket_proxy?
I can't find anything in the documentation on whether this is possible hence requesting the change below.

Proposed change

For arbitrary proxying in JupyterLab, it would be nice to be able to tell JupyterLab to use raw_socket_proxy via the jupyterlab config.

Example:

# jupyter_lab_config.py
c.ProxyServer.raw_socket_proxy = True

Alternative options

Or even overriding the websocket message size limit

# jupyter_lab_config.py
c.ProxyServer.websocket_message_size = 1000 * 1024 * 1024

Who would use this feature?

Anyone using jupyter-server-proxy in JupyterLab to run web apps.

Thanks for your consideration

@Inveracity Inveracity changed the title Configurable websocket settings for non-service proxying Configurable websocket settings for arbitrary proxying Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant