homedash / kankun-json

A CGI script that provides a simple web interface and RESTful JSON API for the Kankun Small K wifi switch.
http://homedash.org
MIT License
34 stars 25 forks source link

Use baseUrl instead of ip #19

Closed stokito closed 6 months ago

stokito commented 3 years ago

To connect to the switch currently we use only IP and always http:// schema. But a switch may have a https schema, hostname and port. This is useful if you are trying to expose the switch for the external access over internet (which is not a good idea but sometimes really needed). The PR is reworked #11 and is based on #17 so first commits are not really related to the feature.

stokito commented 6 months ago

@Japh could you please check the PR?

Japh commented 6 months ago

@stokito Looks good! I'm not sure about the changes to switches.json though. Seems local access should be default, rather than including the DynDNS variation?

stokito commented 6 months ago

This is an example, so the first switch remains local but the second I made as an example of using DuckDNS.org

Japh commented 6 months ago

Oh yeah, I didn't notice that sorry. Will merge, thank you!