diff --git a/docs/widgets/services/fritzbox.md b/docs/widgets/services/fritzbox.md index de63d77f..50f3697a 100644 --- a/docs/widgets/services/fritzbox.md +++ b/docs/widgets/services/fritzbox.md @@ -11,12 +11,12 @@ Home Network > Network > Network Settings > Access Settings in the Home Network [x] Transmit status information over UPnP ``` -You don't need to provide any credentials. +You don't need to provide any credentials. Since that, you should consider using `http` instead of `https` as the requests are significantly faster. Allowed fields (limited to a max of 4): `["connectionStatus", "upTime", "maxDown", "maxUp", "down", "up", "received", "sent", "externalIPAddress"]`. ```yaml widget: type: fritzbox - url: https://192.168.178.1 + url: http://192.168.178.1 ``` diff --git a/src/widgets/fritzbox/proxy.js b/src/widgets/fritzbox/proxy.js index b9c35eed..353231d2 100644 --- a/src/widgets/fritzbox/proxy.js +++ b/src/widgets/fritzbox/proxy.js @@ -60,7 +60,8 @@ export default async function fritzboxProxyHandler(req, res) { } const serviceWidgetUrl = new URL(serviceWidget.url); - const apiBaseUrl = `http://${serviceWidgetUrl.hostname}:49000`; + const port = serviceWidgetUrl.protocol === "https:" ? 49443 : 49000; + const apiBaseUrl = `${serviceWidgetUrl.protocol}//${serviceWidgetUrl.hostname}:${port}`; if (!serviceWidget.fields?.length > 0) { serviceWidget.fields = fritzboxDefaultFields;