nsd 1.0.5 copy "nsd: ^1.0.5" to clipboard
nsd: ^1.0.5 copied to clipboard

outdated

A Flutter plugin for network service discovery and registration (aka NSD / DNS-SD / Bonjour / mDNS).

nsd #

Platform Tests Android Tests iOS Tests macOS Tests License: MIT codecov

A Flutter plugin for network service discovery and registration (aka NSD / DNS-SD / Bonjour / mDNS).

Service Discovery #

import 'package:nsd/nsd.dart';

final discovery = await startDiscovery('_http._tcp');
discovery.addListener(() {
  // discovery.services contains discovered services
});

// ...

await stopDiscovery(discovery);

Service Registration #

import 'package:nsd/nsd.dart';

final registration = await register(
  const Service(name: 'Foo', type: '_http._tcp', port: 56000));

// ...

await unregister(registration);

Example App #

The plugin includes an example application that can be used to start multiple discoveries and register multiple services. It will discover its own services but also other services of type _http._tcp in the local network, such as the printer in the screenshot above.

  • Use the action button to add a discovery or register a new service.
  • Swipe the cards left or right to dismiss a discovery or service.
  • The application log will show the calls and callbacks platform side vs. native side.
  • The source code demonstrates how to use the discovery object as a ChangeNotifier.
52
likes
0
pub points
92%
popularity

Publisher

verified publisherhaberey.com

A Flutter plugin for network service discovery and registration (aka NSD / DNS-SD / Bonjour / mDNS).

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, nsd_android, nsd_ios, nsd_macos, nsd_platform_interface

More

Packages that depend on nsd