This plugin allows you to browse and publish ZeroConf/Bonjour/mDNS services from applications developed using PhoneGap/Cordova 3.0 or newer.
This is not a background service. When the cordova view is destroyed/terminated, publish and watch operations are stopped.
In your application project directory:
cordova plugin add cordova-plugin-zeroconf
var zeroconf = cordovapluginszeroconf;
For Android, you may want set the following options to speed discovery up:
zeroconfregisterAddressFamily = 'ipv4'; // or 'ipv6' ('any' by default)zeroconfwatchAddressFamily = 'ipv4'; // or 'ipv6' ('any' by default)
Returns this device's hostname.
register(type, domain, name, port, txtRecord, success, failure)
Publishes a new service.
unregister(type, domain, name, success, failure)
Unregisters a service.
Unregisters all published services.
watch(type, domain, success, failure)
Starts watching for services of the specified type.
unwatch(type, domain, success, failure)
Stops watching for services of the specified type.
Closes the service browser and stops watching.
Re-initializes the entire plugin, which resets the browsers and services. Use this if the WiFi network has changed while the app is running.
It depends on the JmDNS library
Implements Apple's Bonjour
The MIT License