Add configurable Wake-on-LAN target addresses - #1958
Open
Orkopaede wants to merge 1 commit into
Open
Conversation
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
This pull request adds support for configurable Wake-on-LAN target addresses.
Users can specify one or more IPv4 or IPv6 addresses in the application settings. When waking a host, Moonlight sends the Wake-on-LAN magic packet to each configured address on UDP port 9 before continuing with the existing Wake-on-LAN behavior.
Motivation
Standard Wake-on-LAN broadcasts do not work in some network configurations because broadcast packets are typically not routed across Layer 3 boundaries.
This is particularly relevant for setups such as:
• Hosts or virtual machines located in a different subnet
• VPN connections that only provide Layer 3 connectivity
• Routed networks where broadcast traffic is unavailable
• Networks using a Wake-on-LAN relay or proxy
• Custom network configurations where the normal broadcast destination is insufficient
Allowing users to configure additional target addresses makes it possible to forward the magic packet to a suitable relay, directed broadcast address, router, or other reachable endpoint.
Changes
Example
A user can configure addresses such as:
192.168.1.255, 10.10.0.5, 2001:db8::10
When a host is woken, Moonlight first sends the magic packet to these configured targets and then performs the existing Wake-on-LAN attempts.
Compatibility
The setting is optional. When no custom addresses are configured, Wake-on-LAN continues to behave as before.
Both IPv4 and IPv6 literal addresses are supported. Hostnames and custom ports are intentionally not supported.
Testing
Development assistance
Parts of this change were developed with assistance from OpenAI Codex. The generated and suggested code was reviewed and adjusted before submission.