Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hue.discover CORS policy error #7

Open
wassfila opened this issue Feb 27, 2020 · 2 comments
Open

hue.discover CORS policy error #7

wassfila opened this issue Feb 27, 2020 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@wassfila
Copy link
Member

image

I do not understand why this started to happen, as I expected the discovery to be completely on the local network, why is an external site being requested.

Until clarified, the workaround is to hardcode the ip address in hue_app.js

image

@wassfila wassfila added bug Something isn't working help wanted Extra attention is needed labels Feb 27, 2020
@wassfila
Copy link
Member Author

Philipps is providing an online service to dicover hue bridges inside your own house.
According to the network locality principle of this project, it is better to avoid any dependency from external network.
Therefore the ip address has to be configured by the user/developper, dropping the option of usability without knowing the ip address. A local discovery can be implemented in the future.

solution for the CORS issue is to add 'no-cors' in the header, but then the body is empty, so Philipps kind of restricted the usage of the service to the same origin.

fetch("https://www.meethue.com/api/nupnp",{mode: 'no-cors'})
.then(response => {return response.text()})
.then(data => console.log(data))

@wassfila
Copy link
Member Author

Philipps provides a method for discovery from the local network
https://www.burgestrand.se/hue-api/api/discovery/

The provided solution that runs locally requires ssdp protocol for which a client library exists
https://github.com/diversario/node-ssdp

like most client libraries, they're common to node.j and front end, therefore only implemented with "require" which makes the transpilation a necessary step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant