mdns-js / node-mdns-js

Pure JavaScript/NodeJS mDNS discovery implementation.
Apache License 2.0
161 stars 60 forks source link

Initial IPv6 support #62

Closed TekSiDoT closed 7 years ago

TekSiDoT commented 7 years ago

This is a proposal pull-request creating initial support for IPv6 and respective settings.

Address families can be selected via the following API extension:

    mdns.setAddressFamily(family);

where family is required to be a member of the string enum 'IPv4', 'IPv6', 'both', 'any'.

Additionally, binding to INADDR_ANY can now be disabled on all interfaces via

    mdns.listenOnLinkLocalMulticastOnly();

Both settings have to be set before the interfaces have been started.

I've also included some basic tests, but these are currently restricted to testings the proper function of the new API elements, not the actual process of using IPv6.

I'd love to receive feedback and am willing to improve this PR wherever it is deemed necessary.

kmpm commented 7 years ago

I really appreciate the effort but please have a look at the branch "port5353" which includes a lot of changes to networking and also gives some rudimentary IPv6 support. And I'v filed a separate issue for int in #67

TekSiDoT commented 7 years ago

No problem, I've mainly been toying around with the lib to get a hang of MDNS / DNS-SD. Happy new Year!