Draft: [Feature] Add mDNS Discovery
Advertise IP address through mDNS (Bonjour) so LanLinkProvider can send UDP packets to those addresses directly.
Counterparts
- Android: kdeconnect-android!91 (closed)
- Desktop: kdeconnect-kde!147 (closed)
Protocol
Requires an additional IP address field ("ip") in TXT Record because even Apple sample code can't connect to each other here at UW
service type: "_kdeconnect._tcp"
service name: "KDE Connect on " + deviceName
service port: TCP port
service addr: TCP addr
TXT record:
name: deviceName, String
id: deviceId, String
type: deviceType, not localized, String
version: protocolVersion, String
+ ip: service addr (e.g. "1.1.1.1"), String (NEW), REQUIRED
References
- Apple sample code: Building a Custom Peer-to-Peer Protocol
-
NWBrowser
can't get IP and port, requireNWConnection
orNetService
(deprecated) -
NWListener
cannot set port to be the same as the TCP port on real device
-
Additional Notes
- On University of Washington's restricted network, sometimes even AirDrop can't discover other devices.
- We might be able to use this to tell if we have Local Network permission (which is essential for this app to work)
Edited by Apollo Zhu