Skip to content

Websocket requests are not mapped via mappath #525

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

Open
2xB opened this issue Apr 8, 2025 · 0 comments · May be fixed by #526
Open

Websocket requests are not mapped via mappath #525

2xB opened this issue Apr 8, 2025 · 0 comments · May be fixed by #526
Labels

Comments

@2xB
Copy link

2xB commented Apr 8, 2025

Bug description

Websocket requests are not mapped via mappath. The function is not even called on the websocket URL.

How to reproduce

Write a small server proxy that contains a websocket request, use the mappath config argument to define a function that e.g. just prints and returns the current path. It is not called for the websocket request, the console shows

Trying to establish websocket connection to ws://...
Websocket connection established to ws://...

where ws://... is the original path, not mapped using mappath.

Expected behaviour

ws://... should be a path mapped using the custom mappath function.

Actual behaviour

ws://... is the original, unmapped path.

Your personal set up

  • OS: Fedora Workstation 41
  • Version(s): Jupyter Server Proxy version 4.4.0
@2xB 2xB added the bug label Apr 8, 2025
2xB added a commit to 2xB/jupyter-server-proxy that referenced this issue Apr 13, 2025
This is done by instead of WebSocketHandlerMixin providing the default `get` method and delegating to `ProxyHandler.http_get`, it now provides `get_websocket` and `ProxyHandler.proxy` delegates to it.

Code is also removed that was never reached since it checked for the "Upgrade" HTTP header after removing it among others defined in `hop_by_hop_headers`.

Fixes jupyterhub#525
@2xB 2xB linked a pull request Apr 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant