- 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
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 |
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 |
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 |