mdns_lite icon indicating copy to clipboard operation
mdns_lite copied to clipboard

add get_by_mdns/2

Open axelson opened this issue 3 years ago • 0 comments

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 gethostbyname somehow? i.e. by expanding gethostbyname to 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 :srv records: 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

axelson avatar Dec 23 '22 20:12 axelson