Skip to content

Commit

Permalink
Force legacy ws subprotocol when using gateway (#1311)
Browse files Browse the repository at this point in the history
Co-authored-by: Emmanuel Pignot <[email protected]>
Co-authored-by: Zachary Sailer <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Zachary Sailer <[email protected]>
  • Loading branch information
5 people authored Jan 4, 2024
1 parent c5493d0 commit 4991568
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jupyter_server/gateway/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from tornado.escape import json_decode, url_escape, utf8
from tornado.httpclient import HTTPRequest
from tornado.ioloop import IOLoop
from traitlets import Bool, Instance, Int
from traitlets import Bool, Instance, Int, Unicode

from ..services.kernels.connection.base import BaseKernelWebsocketConnection
from ..utils import url_path_join
Expand All @@ -31,6 +31,11 @@ class GatewayWebSocketConnection(BaseKernelWebsocketConnection):

retry = Int(0)

# When opening ws connection to gateway, server already negotiated subprotocol with notebook client.
# Same protocol must be used for client and gateway, so legacy ws subprotocol for client is enforced here.

kernel_ws_protocol = Unicode("", allow_none=True, config=True)

async def connect(self):
"""Connect to the socket."""
# websocket is initialized before connection
Expand Down

0 comments on commit 4991568

Please sign in to comment.