import { Zeroconf } from '@awesome-cordova-plugins/zeroconf/ngx';
constructor(private zeroconf: Zeroconf) { }
...
this.zeroconf.watch('_http._tcp.', 'local.').subscribe(result => {
if (result.action == 'added') {
console.log('service added', result.service);
} else {
console.log('service removed', result.service);
}
});
this.zeroconf.register('_http._tcp.', 'local.', 'Becvert\'s iPad', 80, {
'foo': 'bar'
}).then(result => {
console.log('Service registered', result.service);
});
this.zeroconf.unregister('_http._tcp.', 'local.', 'Becvert\'s iPad');