Skip to content

Notebook show() on a remote kernel needs a forwarded port #132

Open

Description

@jvdd

Problem

In a notebook, show() displays its dashboard from the local FlexViz server at http://127.0.0.1:<port>. With a remote kernel, the browser that renders the notebook is on another machine, so it reaches that address only when the port is forwarded.

Measured in VS Code Remote-SSH (with #131):

  • show(notebook=True) stays blank. The port does not appear in the Ports view, not after a wait, and not after a click on a http://127.0.0.1:<port> link in the notebook output.
  • show(notebook=False) works: VS Code forwards the port when webbrowser.open hands it the URL. After that, show(notebook=True) on the same port works too.
  • Before fix(server): answer only same-origin pages and loopback host names #131 the result was the same, except that the data: page showed the dashboard shell without data.

The same limit applies to any setup where the notebook frontend and the kernel run on different machines, such as JupyterHub or Colab.

Direction

Carry the dashboard's requests over the Jupyter kernel channel instead of HTTP, as widget libraries do (for example an anywidget / ipywidgets comm). The kernel side calls the same request handling as /dashboard/update, in process. The frontend always reaches the kernel, so no port has to be forwarded.

Open questions:

  • The JS runtime calls fetch(SERVER_URL + ...) in a few places (updates, cube requests, share). They need one transport seam, with HTTP and the kernel channel behind it.
  • Cube bundles are binary; the comm must carry bytes (anywidget supports buffers).
  • A new dependency (anywidget) needs a clear gain over the documented workaround.

Workaround today: pass a fixed port and call show(notebook=False, port=...) once, or forward the port by hand. docs/index.md documents this.

Activity

  1. added
    enhancement
    on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions