vscode-marimo icon indicating copy to clipboard operation
vscode-marimo copied to clipboard

code-server: Not allowed to display insecure content from http://localhost:2718/

Open benz0li opened this issue 1 year ago • 14 comments

Description

Does not work on a non-localhost deployment of code-server, e.g. at https://demo.jupyter.b-data.ch. ℹ️ This deployment uses Træfik as [front-]proxy[^1] and for TLS termination.

[^1]: Other proxies in place: JupyterHub: proxy no. 2; JupyterLab: Jupyter Server Proxy (proxy no. 3); code-server: web app (proxy no. 4)

Reproduce

intro.py.txt

  1. Open https://demo.jupyter.b-data.ch
  2. Sign in with your GitHub account
  3. Select an image and start
  4. Open a Terminal
    • pip install marimo click
  5. Open code-sever
  6. Install the marino extension from VSIX
  7. Upload file intro.py.txt and rename to intro.py
  8. Open file intro.py and start marimo server (edit or run)

Expected behavior

Output can be displayed both in internal and external browser.

Context

https://demo.jupyter.b-data.ch

Browser Output
[Warning] [blocked] The page at https://jupyter.b-data.ch/user/benz0li/test-for-jyio/code-server/stable-0c802ba1652296c79d26ff3e990578e67e6734b1/static/out/vs/workbench/contrib/webview/browser/pre/index.html?id=ab415c6a-f29a-48bf-85d8-8ef42f86a5ac&origin=10019dc9-ce7d-48be-b202-f15aba8dab21&swVersion=4&extensionId=marimo-team.vscode-marimo&platform=browser&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=https%3A%2F%2Fjupyter.b-data.ch&remoteAuthority=jupyter.b-data.ch was not allowed to display insecure content from http://localhost:2718/.

benz0li avatar Jun 22 '24 06:06 benz0li

ShinyApps work just fine in the same context. It also works fine with the Shiny extension – both using the internal[^1] and external browser.

[^1]: Simple Browser

ℹ️ https://shiny.posit.co/r/getstarted/build-an-app/hello-shiny/getting-started.html

benz0li avatar Jun 22 '24 06:06 benz0li

@mscolnick It would be great to have this extension working properly with JupyterLab + code-server. I also advocated for this with other extensions:

R extension

  • https://github.com/REditorSupport/vscode-R/issues/275
    • https://github.com/REditorSupport/vscode-R/pull/803

Quarto extension

  • https://github.com/quarto-dev/quarto-cli/issues/1542
    • https://github.com/quarto-dev/quarto-cli/commit/bc41cdbf33f9227a77f66f5089cb54be7ad40d66
  • https://github.com/quarto-dev/quarto-cli/issues/3352
    • https://github.com/quarto-dev/quarto-cli/pull/3410

LaTeX Workshop extension

  • https://github.com/James-Yu/LaTeX-Workshop/issues/4158
    • https://github.com/James-Yu/LaTeX-Workshop/pull/3639
      • https://github.com/James-Yu/LaTeX-Workshop/commit/e4e48b1a05e4e4f208048b0ef68cdc6d99e2c5bf
      • https://github.com/James-Yu/LaTeX-Workshop/commit/bb97ed00a6f3969163e24d8cbd979bd0b1e15268
      • https://github.com/James-Yu/LaTeX-Workshop/commit/b7ce37384f805965d137292436925dd31f84bfbd

benz0li avatar Jun 26 '24 05:06 benz0li

@benz0li - can you try the pre-release version (>0.3.3)? you can set https, host, and port? Is that enough to bypass this issue?

mscolnick avatar Jun 26 '24 05:06 mscolnick

@benz0li - can you try the pre-release version (>0.3.3)? you can set https, host, and port? Is that enough to bypass this issue?

You may test yourself at https://demo.jupyter.b-data.ch. Login with your GitHub account.
ℹ️ If the server (container) does not start, just try again.

benz0li avatar Jun 26 '24 05:06 benz0li

@mscolnick Not that I am unwilling to test myself... but you get the results faster this way.

And you can check the Browser Console while testing.


P.S.: I consider https://demo.jupyter.b-data.ch a reference deployment where issues [like this one] can be reproduced by any user at any time – independently.

benz0li avatar Jun 26 '24 05:06 benz0li

P.P.S.: @mscolnick There was the same error with the LaTeX Workshop extension. For more information, see https://github.com/James-Yu/LaTeX-Workshop/commit/e4e48b1a05e4e4f208048b0ef68cdc6d99e2c5bf#commitcomment-138712360 ff plus

  • https://github.com/James-Yu/LaTeX-Workshop/commit/bb97ed00a6f3969163e24d8cbd979bd0b1e15268
  • https://github.com/James-Yu/LaTeX-Workshop/commit/b7ce37384f805965d137292436925dd31f84bfbd

benz0li avatar Jun 26 '24 06:06 benz0li

It does not work on GitHub Codespaces with the internal browser either.

Tested using b-data's/my Data Science dev containers, Python scipy image.

benz0li avatar Jun 26 '24 06:06 benz0li

Thanks @benz0li - i hopefully can test it out today (need to make the time)

mscolnick avatar Jun 26 '24 17:06 mscolnick

@benz0li im still unsure how to test in your environment - but hopefully this fixes it https://github.com/marimo-team/vscode-marimo/commit/6bf39d11cb55019995014f02df5d3b0d32123858. I will release shortly

mscolnick avatar Jul 03 '24 20:07 mscolnick

@benz0li im still unsure how to test in your environment

Then, use b-data's/my Data Science dev containers, Python scipy image.

but hopefully this fixes it 6bf39d1.

Unfortunately, it does not.

I will release shortly

Tested with marimo extension v0.4.1.

benz0li avatar Jul 14 '24 13:07 benz0li

Does not work with the marimo extension v0.4.2 either.

benz0li avatar Jul 18 '24 15:07 benz0li

Still does not work with

  1. code-server
    • non-localhost deployment behind proxy
  2. GitHub Codespaces
    • which is – in its essence – the same as 1.

benz0li avatar Aug 16 '24 16:08 benz0li

Any updates here? Would be awesome to get this working in code-server.

legout avatar Sep 10 '24 13:09 legout

ℹ️ The marimo extension in the Open VSX Registry is not up to date...

benz0li avatar Sep 10 '24 13:09 benz0li

Still does not work with code-server or GitHub Codespaces.

Browser Output
2025-10-22 06:45:09.802 [info] marimo extension is now active!
2025-10-22 06:45:09.802 [info] [server-manager]: Could not recover any state
2025-10-22 06:45:11.486 [info] Using interpreter: /usr/local/bin/python
2025-10-22 06:45:11.486 [info] Executing: /usr/local/bin/python ["-m","marimo","--version"]
2025-10-22 06:45:48.885 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2828/ from http://localhost:2828/
2025-10-22 06:45:49.000 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2829/ from http://localhost:2829/
2025-10-22 06:45:49.102 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2830/ from http://localhost:2830/
2025-10-22 06:45:49.193 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2831/ from http://localhost:2831/
2025-10-22 06:45:49.282 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2832/ from http://localhost:2832/
2025-10-22 06:45:49.376 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2833/ from http://localhost:2833/
2025-10-22 06:45:49.495 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2834/ from http://localhost:2834/
2025-10-22 06:45:49.591 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2835/ from http://localhost:2835/
2025-10-22 06:45:49.677 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2836/ from http://localhost:2836/
2025-10-22 06:45:49.767 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2837/ from http://localhost:2837/
2025-10-22 06:45:49.851 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2838/ from http://localhost:2838/
2025-10-22 06:45:49.973 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2839/ from http://localhost:2839/
2025-10-22 06:45:50.057 [info] Mapping to external url https://demo.jupyter.b-data.ch/user/benz0li/code-server/proxy/2840/ from http://localhost:2840/
...

benz0li avatar Oct 22 '25 04:10 benz0li

Hi, we've launched a new VSCode extension at https://github.com/marimo-team/marimo-lsp (readme). It may mean this issue is resolved or no longer applicable. If the issue still exists, please file the issue on over on the new Issues page.

mscolnick avatar Nov 05 '25 18:11 mscolnick