Hey champions, Let's quickly dive into how we can connect our local jupyter runtime to colab notebook.

First, let's setup our environment. install jupyter_http_over_ws package by

pip install jupyter_http_over_ws

Then, enable it by:

jupyter server extension enable --py jupyter_http_over_ws

Start jupyter notebook by following command:

jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0 --NotebookApp.token='mytoken' &

This will set our token as 'mytoken'.

server started with token
Token is set in started server link.

Now, head over to colab, then click on Connect to Local runtime:

connect to local colab1
Connect to a local runtime.

Then, enter the link as shown.

connect to loca colab1
Local server link with token

If you try to connect without a token, or a wrong token, then it won't connect and shows following error:

terminal blocking output
Error: can't connect to local runtime.