Connect to a remote Jupyter runtime over HTTPS with Google Colab

Viewed 2536

I'm trying to use Google's Colab feature to connect to a remote run-time that is configured with HTTPS. However, I only see an option to inform the port on the UI, not the protocol.

I've checked the Network panel and the website starts a WebSocket connection with http://localhost:8888/http_over_websocket?min_version=0.0.1a3, HTTP-style.

Full details of my setup:

  • I have a public Jupyter server at https://123.123.123.123:8888 with self-signed certificate and password authentication
  • I've followed jupyter_http_over_ws' setup on the remote
  • I started the remote process with jupyter notebook --no-browser --keyfile key.pem --certfile crt.pem --ip 0.0.0.0 --notebook-dir notebook --NotebookApp.allow_origin='https://colab.research.google.com'
  • I've created a local port forwarding with ssh -L 8888:localhost:8888 dev@123.123.123.123
  • I've turned on network.websocket.allowInsecureFromHTTPS on Firefox
  • I've went to https://localhost:8888 and logged in

Naturally, when the UI calls http://localhost:8888/http_over_websocket?min_version=0.0.1a3 it fails. If I manually access https://localhost:8888/http_over_websocket?min_version=0.0.1a3 (note the extra s) it gets through.

I see three options to solve it:

  1. Tell the UI to use secure WS connection
  2. Run a proxy on my local machine to transform the HTTPS into plain HTTP
  3. Turn off HTTPS on my remote

The last two I think will work, but I wouldn't like that way. How to do #1?

Thanks a lot!

1 Answers

Your option 1 isn't possible in colab today.

Why do you want to use HTTPS over an SSH tunnel that already encrypts forwarded traffic?

Related