Skip to content

Commit

Permalink
Register websocket handler from same module as kernel handlers (#1249)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-bates authored Mar 27, 2023
1 parent 5213ed4 commit 6ad8006
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
"files": ["jupyter_server.files.handlers"],
"kernels": [
"jupyter_server.services.kernels.handlers",
"jupyter_server.services.kernels.websocket",
],
"kernelspecs": [
"jupyter_server.kernelspecs.handlers",
Expand Down
2 changes: 2 additions & 0 deletions jupyter_server/services/kernels/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from jupyter_server.utils import url_escape, url_path_join

from ...base.handlers import APIHandler
from .websocket import KernelWebsocketHandler

AUTH_RESOURCE = "kernels"

Expand Down Expand Up @@ -121,4 +122,5 @@ async def post(self, kernel_id, action):
rf"/api/kernels/{_kernel_id_regex}/{_kernel_action_regex}",
KernelActionHandler,
),
(r"/api/kernels/%s/channels" % _kernel_id_regex, KernelWebsocketHandler),
]
7 changes: 0 additions & 7 deletions jupyter_server/services/kernels/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from jupyter_server.base.handlers import JupyterHandler
from jupyter_server.base.websocket import WebSocketMixin

from .handlers import _kernel_id_regex

AUTH_RESOURCE = "kernels"


Expand Down Expand Up @@ -94,8 +92,3 @@ def select_subprotocol(self, subprotocols):
selected_subprotocol = preferred_protocol if preferred_protocol in subprotocols else None
# None is the default, "legacy" protocol
return selected_subprotocol


default_handlers = [
(r"/api/kernels/%s/channels" % _kernel_id_regex, KernelWebsocketHandler),
]

0 comments on commit 6ad8006

Please sign in to comment.