这是indexloc提供的服务,不要输入任何密码

mdns_dart 1.0.2 copy "mdns_dart: ^1.0.2" to clipboard
mdns_dart: ^1.0.2 copied to clipboard

A comprehensive mDNS (Multicast DNS) service discovery library for Dart, ported from HashiCorp Go implementation.

mdns_dart #

About #

mdns_dart is a pure Dart implementation of Multicast DNS (mDNS) for service discovery and advertising on local networks. This library is a direct port of the proven HashiCorp mDNS implementation, adapted for the Dart ecosystem. It requires no native dependencies and works across platforms, including Docker and bridge networks.

This project is not affiliated with HashiCorp. All original credit goes to HashiCorp; this port is maintained for Dart and Flutter developers.

Features #

Feature This Library multicast_dns nsd flutter_nsd
Interface Binding Full support Default only Platform dependent Platform dependent
Docker/Bridge Networks Works perfectly Limited Platform dependent Platform dependent
Service Advertising Full server Discovery only Via platform APIs Via platform APIs
Pure Dart No native deps Pure Dart Platform plugins Platform plugins
Direct Socket Control No control Limited No control No control
Cross-Network Discovery Solved Broken Platform dependent Platform dependent

Getting Started #

Add to your pubspec.yaml:

dependencies:
  mdns_dart: ^latest

Minimal Example #

import 'package:mdns_dart/mdns_dart.dart';

void main() async {
  // Discover all HTTP services on the local network
  final results = await MDNSClient.discover('_http._tcp');
  for (final service in results) {
    print('Service: \\${service.name} at \\${service.primaryAddress?.address}:\\${service.port}');
  }
}

For more advanced usage, see the example/ directory.

License #

This project is licensed under the MIT License, originally by HashiCorp. See the LICENSE file for details.

3
likes
0
points
491
downloads

Publisher

unverified uploader

Weekly Downloads

A comprehensive mDNS (Multicast DNS) service discovery library for Dart, ported from HashiCorp Go implementation.

Repository (GitHub)
View/report issues

Topics

#mdns #dns #service-discovery #multicast #networking

License

unknown (license)

More

Packages that depend on mdns_dart