Download the PHP package clue/wol-react without Composer
On this page you can find all versions of the php package clue/wol-react. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download clue/wol-react
More information about clue/wol-react
Files in clue/wol-react
Package wol-react
Short Description Turn on your PC with Wake-On-LAN (WOL) requests
License MIT
Homepage https://github.com/clue/wol-reactphp
Informations about the package wol-react
clue/wol-react
Turn on your PC with Wake-On-LAN (WOL) requests
Note: This project is in beta stage! Feel free to report any issues you encounter.
Usage
Once installed, using this library is as simple as running:
If your environment requires a non-default broadcast address (the default is: 255.255.255.255:7
), for example 1.2.3.4:9
. You can pass that to the createSender
method on the Factory
. For example:
There's also a CLI script in bin/wol.php
to send a WOL request from the
command line simply by running:
Introduction
The following short introduction is mostly taken from wikipedia's article about WOL:
Wake-on-LAN ("WOL") is implemented using a specially designed packet called a magic packet, which is sent to the computer to be woken up. The magic packet contains the MAC address of the destination computer. Powered-down computers capable of Wake-on-LAN will contain network devices able to "listen" to incoming packets in low-power mode while the system is powered down. If a magic packet is received that is directed to the device's MAC address, the NIC signals the computer's power supply to initiate system wake-up, much in the same way as pressing the power button would do.
The magic packet is a broadcast frame containing anywhere within its payload 6 bytes of all 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's 48-bit MAC address, for a total of 102 bytes.
Since the magic packet is only scanned for the string above, and not actually parsed by a full protocol stack, it may be sent as any network- and transport-layer protocol, although this library uses a typical UDP datagram. The magic packet is usually sent on the data link layer (layer 2 in the OSI model) and when sent, is broadcast to all attached devices on a given network, using the network broadcast address; the IP-address (layer 3 in the OSI model) is not used.
Install
The recommended way to install this library is through composer. New to composer?
License
MIT