1.0.7 • Published 7 years ago

aloha-sd v1.0.7

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

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 = require('aloha-sd')

aloha.find((err, result) =>{
    if (err) console.log(err)

    if(result){
        console.log(JSON.stringify(result,null,4))
    }
},'_http._tcp')

CLI

aloha-sd [options]
aloha-sd -l _http._tcp

Options:

shortfulldescription
-h--helpoutput usage information
-V--versionoutput the version number
-a--allBrowse for all services, regardless of the type
-l "service type"--lookup "service type"Browse for specific service type

API

Initializing

var aloha = require('aloha-sd')

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

TypePropertyDescription
Functioncallbackcalled when a service has been found.The callback parameter should be a function that looks like this:function (string error, Service result){...};StringerrorThe error return from browsingService ObjectresultThe service return from browsing
Stringservice_typeExample: '_http._tcp'. List of known service_types hereLet it null for browse all.

finder.shutdown()

Stop looking for matching services.

Service

Service look like this

{
name: string,
type: string,
fqdn: string,
host: string,
port: string,
ipv4: [],
ipv6: [],
txt: object,
status: boolean
}

Service.status

A boolean indicating if the service is currently added (true) or removed (false)

Publish

On development.

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago