voodoohop / auto-socket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Functions

createService(serviceDescription)

Create Websocket service on a free port and automatically broadcast it via bonjour

findService(options, callback)

find a service that matches the given type.

findServiceOnce(options)

Same as findService but returns a promise that resolves as soon as a service is found that meets the requirements

createService(serviceDescription)

Create Websocket service on a free port and automatically broadcast it via bonjour

Kind: global function

Param Default Description
serviceDescription Service configuration
serviceDescription.isUnique True if multiple services of the same name are allowed to coexist
serviceDescription.name The service name. This is not used for discovery
serviceDescription.type The service type. This is used for discovery.
serviceDescription.txt Additional metadata to pass in the DNS TXT field

findService(options, callback)

find a service that matches the given type.

Kind: global function

Param Type Default Description
options options
options.type string The type of service
options.txt object Metadata
options.local boolean true Whether to look only on the local host for services
callback func Callback which is called any time a new service is found that satistfies the query

findServiceOnce(options)

Same as findService but returns a promise that resolves as soon as a service is found that meets the requirements

Kind: global function

Param
options

About


Languages

Language:JavaScript 84.2%Language:Shell 15.8%