Repository navigation
Conversation
Advertise each instance as a `_lan-mouse._udp` DNS-SD service and browse for other instances. Nearby devices are listed with `cli discover`, added with `cli add-discovered <name> <pos>` and allowed to control this device with `cli authorize-discovered <name>`. Clients whose hostname matches a discovered device get its announced addresses kept up to date. Discovery can be turned off with `discovery = false` in the config. Also make every CLI command wait until the service has handled it. On Windows, exiting right after a request could reset the IPC connection and the service dropped requests it had not read yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dress Some routers drop multicast between Wi-Fi and Ethernet, so devices on different sides never see each other's mDNS announcements. Each instance now also broadcasts a small JSON beacon on UDP port 4241 every few seconds (and answers beacons directly), and reports from both methods are merged per device. Beacons time out when a device stops sending them. A discovered device now also belongs to a client when it announces one of the client's configured or resolved addresses, not only its hostname. Co-Authored-By: Claude Opus 5.5 <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.
What this does
Lan Mouse devices on the same network find each other, so they can be added without typing a hostname or IP address.
_lan-mouse._udpDNS-SD service over mDNS (the pure-Rustmdns-sdcrate, so no Avahi/Bonjour dependency). The TXT record carries the device name, its certificate fingerprint and its OS.lan-mouse cli discoverlists nearby devices with their addresses and fingerprints.lan-mouse cli add-discovered <name> <left|right|top|bottom>adds (or reuses) a client for a device and activates it.lan-mouse cli authorize-discovered <name>lets that device control this one.discovery = falsein the config turns it off. It needs UDP 5353 (mDNS) and 4241 (broadcast); the firewalld service file is updated.It also includes a small fix the new commands rely on: every CLI command now waits until the service has handled it (a
Ping/Ponground trip). On Windows, the CLI exiting right after writing a request could reset the IPC connection, and the service dropped requests it had not read yet. I'm happy to split this into its own PR if you prefer.Related
.localnames, but devices running Lan Mouse no longer need a hostname at all.Security note
authorize-discoveredtrusts the fingerprint a device announces on the network, so it is only meant for trusted networks.discoverlists the fingerprints for comparison, and the README says so.Not included
There is no GUI for discovered devices yet; it's CLI only, like the README says. If you like the approach, I can add a "nearby devices" list to the GTK window in a follow-up.
Testing
#[ignore]d tests discover a peer over real sockets.double_must_uselint flags the#[async_trait]traits ininput-emulation, somainfails it too now. chore(deps): update async-trait to 0.1.92 (fixes clippy with Rust 1.99) #531 fixes that by updating async-trait to 0.1.92.AI disclosure
This was written with the help of AI (Claude by Anthropic) and tested on my own Windows PC and Mac.