Skip to content

Commit

Permalink
README: Comment on windows broadcast issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
agnat committed May 20, 2018
1 parent 1cc5e4b commit 1c4f1ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ wol.wake('20:DE:20:DE:20:DE', function(error) {
var magic_packet = wol.createMagicPacket('20:DE:20:DE:20:DE');
````

See [windows notes](#windows-notes).

## Reference

MAC addresses are strings and may use any separator or no separator at all:
Expand Down Expand Up @@ -59,6 +61,16 @@ createMagicPacket(mac)

Returns a buffer with a magic packet for the given MAC address.

## Windows Notes

Because windows routes global broadcasts differently from unix systems, it is necessary to specify a broadcast address manually, e.g:

````
wol.wake(someMac, { address: "192.168.2.255" }, wakeCallback);
````

Use [`os.networkInterfaces()`](https://nodejs.org/api/os.html#os_os_networkinterfaces) to calculate the broadcast address dynamically. See [@mwittig's comment](/~https://github.com/agnat/node_wake_on_lan/issues/4#issuecomment-156404241) for further information.

## Contributors

* Jann Horn [@thejh](http://github.com/thejh)
Expand Down

0 comments on commit 1c4f1ed

Please sign in to comment.