let the user choose wether to use http or https

This commit is contained in:
Thorben Grove 2023-12-05 08:14:24 +01:00
parent e6af309f37
commit d6588a694c
2 changed files with 4 additions and 3 deletions

View File

@ -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
```

View File

@ -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;