menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Theia

Eclipse Theia - Cloud & Desktop IDE

Channels
Team

How can I get my local or dockerized Theia to use https?

March 4, 2020 at 6:43pm

How can I get my local or dockerized Theia to use https?

March 4, 2020 at 6:43pm (Edited 2 years ago)
My extension's webviews don't work when I run theia locally, but they do work when I run it in Theia in Che. I suspect the difference is because in che we're using https. How do I get local theia to use https?
Image Pasted at 2020-3-3 13-23.png

March 4, 2020 at 6:45pm
I tried export THEIA_WEBVIEW_EXTERNAL_ENDPOINT=localhost and then the error changed to "can't establish a connection to localhost". Then I tried export THEIA_WEBVIEW_EXTERNAL_ENDPOINT=localhost:3000 and then the error changed to a 404 "Cannot GET /webview/index.html

March 5, 2020 at 8:04am
you may also take a look at the https docker example theia-https

March 5, 2020 at 8:23pm
After some more testing, the problem is not related to http/s. It is because you are not supposed to subdomain localhost. It works in Chrome because of https://webmasters.stackexchange.com/questions/88636/why-does-chrome-resolve-websitename-localhost-as-localhost but it does not work in other browsers
Edited
If you want to reproduce it, you can download my extension here: http://download.eclipse.org/codewind/codewind-vscode/master/latest/codewind.vsix and install it into Theia. It will try to open the home page webview when it activates, and fail.
Edited

March 6, 2020 at 8:29am
yes, there are issues filed for FireFox to allow subdomain localhost, it generally makes testing of latest Web features nightmare locally