jupyterhub / jupyter-server-proxy

Jupyter notebook server extension to proxy web services.
https://jupyter-server-proxy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
347 stars 148 forks source link

Keep proxying all requested subprotocols #462

Closed consideRatio closed 6 months ago

consideRatio commented 6 months ago

When jupyter-server-proxy proxies websockets, its finalizes the websocket handshake between client/proxy before it initiates the proxy/server websocket handshake.

In #458 released with 4.1.1 earlier today the thinking was that it was a better compromise to not forward all subprotocol choices in the proxy/server handshake if we had prematurely picked a single choice in the client/proxy handshake. This turns out to have introduced a regression though, as at least bokeh had been using secondary subprotocol choices to pass other information such as base64 encoded JSON with keys like session_id, session_expiry and __bk__zlib_.

This commit makes sure we keep passing all requested subprotocols, even though we have prematurely picked a specific ahead of time - which is a bug tracked in https://github.com/jupyterhub/jupyter-server-proxy/issues/459. With this bug, we just have to pick the less buggy workaround, which may be to proxy all requested subprotocols.


Thank you @rcthomas for reporting this so quickly after 4.1.1 in #459!!