mdns_lite
mdns_lite copied to clipboard
add get_by_mdns/2
The current does not work with PTR (such as the _elg._tcp.local used by https://github.com/lawik/keylight). This PR adds a new function get_by_mdns that supports looking up PTR records.
Open questions and thoughts:
- The name and docs of this function are inaccurate/confusing because I don't fully understand MDNS, they should be updated before merging
- Should this be combined with
gethostbynamesomehow? i.e. by expandinggethostbynameto support both types of queries? - Should this be extended so that it is useful enough for https://github.com/lawik/keylight?
- Specifically keylight needs at least the port from
:srvrecords: https://github.com/axelson/mdns_lite/blob/0021e43bc8a3e6c304fd85c1664ebadd82141061/lib/mdns_lite/dns.ex#L57-L67 - But if we include that, perhaps there's additional metadata that is needed as well
- Specifically keylight needs at least the port from