Skip to content

Commit 4991568

Browse files
epignotEmmanuel PignotZsailerpre-commit-ci[bot]
authored
Force legacy ws subprotocol when using gateway (#1311)
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]>
1 parent c5493d0 commit 4991568

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jupyter_server/gateway/connections.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from tornado.escape import json_decode, url_escape, utf8
1414
from tornado.httpclient import HTTPRequest
1515
from tornado.ioloop import IOLoop
16-
from traitlets import Bool, Instance, Int
16+
from traitlets import Bool, Instance, Int, Unicode
1717

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

3232
retry = Int(0)
3333

34+
# When opening ws connection to gateway, server already negotiated subprotocol with notebook client.
35+
# Same protocol must be used for client and gateway, so legacy ws subprotocol for client is enforced here.
36+
37+
kernel_ws_protocol = Unicode("", allow_none=True, config=True)
38+
3439
async def connect(self):
3540
"""Connect to the socket."""
3641
# websocket is initialized before connection

0 commit comments

Comments
 (0)