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

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?

[original thread by Tim Etchells]

[Tim Etchells]

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

Please look through Similar issue was resolved there.

@timetchells you may also take a look at the https docker example theia-https

[Tim Etchells]

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
but it does not work in other browsers

[Tim Etchells]

If you want to reproduce it, you can download my extension here:
and install it into Theia. It will try to open the home page webview when it activates, and fail.

yes, there are issues filed for FireFox to allow subdomain localhost, it generally makes testing of latest Web features nightmare locally