diff --git a/jupyter_server/gateway/connections.py b/jupyter_server/gateway/connections.py index e06d0d0562..a438c355b3 100644 --- a/jupyter_server/gateway/connections.py +++ b/jupyter_server/gateway/connections.py @@ -12,7 +12,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 @@ -30,6 +30,10 @@ 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("") + async def connect(self): """Connect to the socket.""" # websocket is initialized before connection