Feat: Add SSL support for webserver + websocket (#612)

* Feat: Add SSL support for webserver + websocket

Finally, Hyperion reaches the SSL century!
- Uses by default a internal key and certificate to provide working HTTPS out-of-the-box
- Your browser won't like that, for a green ssl seal next to the browser address bar you need to use Let's Encrypt with a own legit domain. This is out of the scope of Hyperion
This commit is contained in:
brindosch
2019-08-21 16:09:28 +02:00
committed by GitHub
parent fe12b36fce
commit 8e5f3251b5
14 changed files with 268 additions and 12 deletions

View File

@@ -74,7 +74,7 @@ function initWebSocket()
if (window.websocket == null)
{
window.jsonPort = (document.location.port == '') ? '80' : document.location.port;
window.websocket = new WebSocket('ws://'+document.location.hostname+":"+window.jsonPort);
window.websocket = (document.location.protocol == "https:") ? new WebSocket('wss://'+document.location.hostname+":"+window.jsonPort) : new WebSocket('ws://'+document.location.hostname+":"+window.jsonPort);
window.websocket.onopen = function (event) {
$(window.hyperion).trigger({type:"open"});