From c3c28175cac3fe9a5dc4ed8818f3ed7b2f383f7d Mon Sep 17 00:00:00 2001 From: alfrix Date: Fri, 18 Nov 2022 13:54:16 -0300 Subject: [PATCH] use https with port 7130 and mention the behaviour in the docs --- docs/Configuration.md | 1 + ks_includes/KlippyRest.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index f541896f..6e7a31fc 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -41,6 +41,7 @@ Multiple printers can be defined [printer Ender 3 Pro] # Define the moonraker host/port if different from 127.0.0.1 and 7125 moonraker_host: 127.0.0.1 +# ports 443 and 7130 will use https/wss moonraker_port: 7125 # Moonraker API key if this is not connecting from a trusted client IP moonraker_api_key: False diff --git a/ks_includes/KlippyRest.py b/ks_includes/KlippyRest.py index 9648dd57..d3206b36 100644 --- a/ks_includes/KlippyRest.py +++ b/ks_includes/KlippyRest.py @@ -12,7 +12,7 @@ class KlippyRest: @property def endpoint(self): protocol = "http" - if int(self.port) == 443: + if int(self.port) in {443, 7130}: protocol = "https" return f"{protocol}://{self.ip}:{self.port}"