Skip to content
pubscout

nsd

5.0.1, released 8 months ago by haberey.com

Flutter plugin for network service discovery and registration (mDNS, Bonjour, DNS-SD).

$ flutter pub add nsd
Source repository

What it does

A Flutter plugin that allows applications to discover network services and register local services on the local network using mDNS, DNS-SD, and Bonjour protocols.

AI-written summary of version 5.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to discover local network devices or services like printers or media servers.
  • You are building local multi-player games or peer-to-peer applications.

Skip it when

  • You need to communicate over the public internet via traditional REST/GraphQL APIs.

Strengths

  • Supports multiple platforms including Android, iOS, macOS, and Windows.
  • Provides automatic IP address lookup options for discovered services.

Weaknesses

  • Requires platform-specific configuration and permissions for Android and iOS.
  • Requires minimum OS versions (Android 5.0, iOS 13.0, macOS 10.15, Windows 10).

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
5

Requires adding INTERNET and multicast permissions to AndroidManifest.xml and NSLocalNetworkUsageDescription / NSBonjourServices keys to iOS Info.plist.

import 'package:nsd/nsd.dart';

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

// ...

await stopDiscovery(discovery);

Alternatives

Packages that do the same job and could replace nsd.

Works with

Packages commonly used together with nsd: ones it builds on, ones built on it, and its own family.