Jupyter HTTP-over-WebSocket

0.0.8 · active · verified Thu Apr 16

Jupyter HTTP-over-WebSocket is a Jupyter server extension (version 0.0.8) maintained by the Google Colaboratory team. It enables Jupyter notebooks to proxy HTTP traffic over WebSockets, which is crucial for bypassing browser-imposed cross-domain HTTP restrictions when connecting to a localhost Jupyter server. The project has a low release cadence, with the last update in March 2020.

Common errors

Warnings

Install

Quickstart

This quickstart installs the necessary package, enables the server extension, and starts a Jupyter Notebook server configured to allow connections from a specified origin (e.g., Google Colab) via HTTP-over-WebSocket. The `--no-browser` flag is recommended to manually open the authentication URL in your preferred browser, ensuring the necessary auth cookie is set.

pip install jupyter_http_over_ws
jupyter serverextension enable --py jupyter_http_over_ws

# Start Jupyter Notebook with an allowed origin for WebSocket proxying
jupyter notebook \
    --NotebookApp.allow_origin='https://colab.research.google.com' \
    --port=8888 \
    --no-browser

# Note: Open the URL printed in the terminal from your browser to authenticate and set cookies.

view raw JSON →