ItsEthra / typst-live

Hot reloading for your typst files
MIT License
85 stars 8 forks source link

Add support for hot-reload on HTTPS #23

Closed TECHNOFAB11 closed 3 weeks ago

TECHNOFAB11 commented 3 weeks ago

I'm using this on coder (remote dev workspaces in the cloud) and when serving it automatically forwards the open ports in the workspace to a special subdomain, all on HTTPS. In the index.html the protocol is hardcoded to "ws:" though, which the browser then prevents from loading because it's insecure. Best solution would be to check if the page is loaded securely or insecurely and then adding/removing the 's' to the protocol aswell (ws/wss), maybe like this?

const protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
TECHNOFAB11 commented 3 weeks ago

That was fast, thanks a lot! :slightly_smiling_face: