How to use the bonjour.Bonjour function in bonjour

To help you get started, we’ve selected a few bonjour examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / bonjour / bonjour-tests.ts View on Github external
import * as bonjour from 'bonjour';

var bonjourOptions: bonjour.BonjourOptions;
var bonjourInstance: bonjour.Bonjour;

var serviceOptions: bonjour.ServiceOptions;
var service: bonjour.Service;

var browserOptions: bonjour.BrowserOptions;
var browser: bonjour.Browser;

bonjourOptions = { interface: '192.168.1.1', port: 5353 };
bonjourInstance = new bonjour.Bonjour(bonjourOptions);

serviceOptions = { name: 'My Web Server', type: 'http', port: 3000 };
service = bonjourInstance.publish(serviceOptions);

browserOptions = { protocol: 'tcp', type: 'http' };
browser = bonjour.find(browserOptions);

bonjour

A Bonjour/Zeroconf implementation in pure JavaScript

MIT
Latest version published 9 years ago

Package Health Score

60 / 100
Full package analysis