Closed vstreammedia closed 6 years ago
No clue really...
Some sort of firewall preventing outgoing UDP broadcasts?
Maybe use wireshark to make sure windows actually sends a packet and it looks the same as on mac os?
Hi guys! Apparently, the problem is the routing behaviour for the global broadcast address on Windows as the IP packets will only be propagated through the first network interface found. The following article describes the matter. Work-around: Set the "address" property to the broadcast address for your local network / the subnet. Here is an example which works for my setup.
wol.wake(theMac, { address: "192.168.178.255" }, wakeCB);
EDIT: If you're not sure how to calculate the broadcast address see this article or simply use an online calculator
Thanks @mwittig. This is really helpful. IP address and net mask are available at runtime using os.networkInterfaces()
.
Yes, os.networkInterfaces()
can be used to collect all netmasks to send the wol packet via each interface. Note, however, "netmask" is not included in node v0.10. Unfortunately, I have still to support v0.10 in some of my projects. See also https://github.com/nodejs/node-v0.x-archive/issues/5731
The sample code works perfectly fine from MacOS but is not running on Windows. any idea why? same Node versions on both machines.
Regards, Andrés.