aloha-sd
A Bonjour/Zeroconf protocol implementation in pure JavaScript. Publish services on the local network or discover existing services using multicast DNS.
Installation
npm install -g aloha-sd
Usage
var aloha = aloha
CLI
aloha-sd [options]
aloha-sd -l _http._tcp
Options:
short | full | description |
---|---|---|
-h | --help | output usage information |
-V | --version | output the version number |
-a | --all | Browse for all services, regardless of the type |
-l "service type" | --lookup "service type" | Browse for specific service type |
API
Initializing
var aloha =
Browsing
var finder = aloha.findAll(callback)
Browser for all services, regardless of the type
var finder = aloha.find(callback,service_type)
Browser for all services with given service_type
Type | Property | Description | ||||||
---|---|---|---|---|---|---|---|---|
Function | callback | called when a service has been found. The callback parameter should be a function that looks like this: function (string error, Service result){...};
|
||||||
String | service_type | Example: '_http._tcp'. List of known service_types here Let it null for browse all. |
finder.shutdown()
Stop looking for matching services.
Service
Service look like this
name: stringtype: stringfqdn: stringhost: stringport: stringipv4: ipv6: txt: objectstatus: boolean
Service.status
A boolean indicating if the service is currently added (true) or removed (false)
Publish
On development.