feat: add mDNS/DNS-SD LAN server discovery#84
Merged
Conversation
Register KDown daemon servers via mDNS on startup and discover them from the Add Remote Server dialog. mDNS registration runs on a background daemon thread to avoid blocking the UI. - Server: register/unregister mDNS service with configurable name/type - App: LanServerDiscovery with expect/actual (JmDNS on Android/JVM, stubs on iOS/WasmJs) - UI: "Discover on LAN" button with progress indicator and result chips - Android: multicast lock + CHANGE_WIFI_MULTICAST_STATE permission Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Replace JVM-only JmDNS with dns-sd-kt KMP library for native mDNS support on Android (NSD), iOS (Bonjour), and JVM. This enables real iOS discovery and eliminates manual expect/actual boilerplate. - Server: MdnsRegistrar interface + DnsSdRegistrar using createNetService() - Client: MdnsDiscoverer interface with DnsSdDiscoverer on Android/JVM/iOS, NoOp on WasmJs; LanServerDiscovery accepts injected discoverer - UI: DiscoveryState sealed interface, toggle Discover/Stop button, ListItem replacing AssistChip, inline error/empty states - Shared MDNS_SERVICE_TYPE constant in library/api - Delete AndroidNetworkEnvironment, old platform LanServerDiscovery actuals - 27 tests covering discovery dedup/sorting and registration lifecycle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Declare NEARBY_WIFI_DEVICES in the manifest and request it at runtime on API 33+ to comply with Android 16 local network permission changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
JmDNS conflicts with macOS's built-in mDNSResponder, making registered services invisible to native mDNS tools. Add NativeMdnsRegistrar that uses the `dns-sd -R` subprocess on macOS, falling back to dns-sd-kt (JmDNS) on other platforms. Move mDNS classes to server.mdns package and add KDownLogger throughout KDownServer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace Thread+runBlocking with a CoroutineScope(Dispatchers.IO) for mDNS registration. The coroutine registers the service, suspends via awaitCancellation(), and unregisters in the finally block when the scope is cancelled on stop(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
KDownServerConfiggainsmdnsEnabled,mdnsServiceName,mdnsServiceTypeproperties;KDownServerregisters/unregisters mDNS service on start/stopLanServerDiscoveryexpect/actual withDiscoveredServerdata classAndroidNetworkEnvironmentfor multicast lock management,CHANGE_WIFI_MULTICAST_STATEpermissionAddRemoteServerDialoggains discovery button and server chipsTest plan
dns-sd -B _kdown._tcp)KDownServerConfigTestpasses with new default/custom values🤖 Generated with Claude Code