MoosicBox mDNS
Simple multicast DNS (mDNS) service registration library for the MoosicBox ecosystem, providing basic service announcement capabilities on local networks using the Zeroconf/Bonjour protocol.
Features
- Service Registration: Register MoosicBox services on the local network
- mDNS Service Discovery: Basic mDNS service announcement support
- Network Scanning: Optional network device scanning capabilities
- Error Handling: Basic error handling for service registration
- Hostname Detection: Automatic hostname detection for service registration
Installation
Add this to your Cargo.toml:
[]
= "0.1.1"
# Enable scanner feature for network discovery
= { = "0.1.1", = ["scanner"] }
Usage
Service Registration
use ;
async
Service Type
The library uses a standard service type for MoosicBox servers:
use SERVICE_TYPE;
println!; // "_moosicboxserver._tcp.local."
Error Handling
use RegisterServiceError;
match register_service.await
Features
- Default: Basic service registration functionality
- scanner: Additional network scanning capabilities
- simulator: Use simulator instead of real mDNS for testing
Dependencies
mdns-sd: Core mDNS service daemon functionalityhostname: System hostname detectionthiserror: Error handling utilities
Error Types
RegisterServiceError: Wraps mDNS and I/O errors during service registration
The library provides a simple interface for announcing MoosicBox services on local networks, making them discoverable by other devices using standard mDNS/Bonjour protocols.