Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working from windows #4

Closed
vstreammedia opened this issue Aug 14, 2015 · 5 comments
Closed

not working from windows #4

vstreammedia opened this issue Aug 14, 2015 · 5 comments

Comments

@vstreammedia
Copy link

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.

@agnat
Copy link
Owner

agnat commented Aug 14, 2015

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?

@mwittig
Copy link

mwittig commented Nov 13, 2015

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

@agnat
Copy link
Owner

agnat commented Nov 13, 2015

Thanks @mwittig. This is really helpful. IP address and net mask are available at runtime using os.networkInterfaces().

@mwittig
Copy link

mwittig commented Nov 13, 2015

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 nodejs/node-v0.x-archive#5731

@agnat
Copy link
Owner

agnat commented May 20, 2018

I added a note to the README in 1c4f1ed.

@agnat agnat closed this as completed May 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants