Closed bobbolous closed 4 months ago
Yes, this is the expected behavior. It's just how docker networks work.
You can close the port and use use the internal docker network if you want. Home assistant and other add-ons can use the hostname of the add-on instead of the ip address.
For me the rest-api does only work with an IP from the outside. The local IP or localhost as suggested in the examples do not work. I guess this relates to the docker image. So right now the API is exposed to everyone in my local network, instead of restricted to the local machine. The following works from anywhere in the local network.
curl -X GET -H "Content-Type: application/json" '192.168.0.123:8080/v1/groups/<number>'
The following:
curl -X GET -H "Content-Type: application/json" '127.0.0.1:8080/v1/groups/<number>'
curl -X GET -H "Content-Type: application/json" 'localhost:8080/v1/groups/<number>'
both return:curl: (7) Failed to connect to localhost port 8080 after 0 ms: Couldn't connect to server
Is this expected behaviour? Any chance I can change this behaviour to expose the API only on the local machine?