2017 © Pedro Peláez
 

library wol-react

Turn on your PC with Wake-On-LAN (WOL) requests

image

clue/wol-react

Turn on your PC with Wake-On-LAN (WOL) requests

  • Monday, March 9, 2015
  • by clue
  • Repository
  • 2 Watchers
  • 14 Stars
  • 390 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

clue/wol-react Build Status

Turn on your PC with Wake-On-LAN (WOL) requests, (*1)

Note: This project is in beta stage! Feel free to report any issues you encounter., (*2)

Usage

Once installed, using this library is as simple as running:, (*3)

$loop = React\EventLoop\Factory::create();
$wolFactory = new Clue\React\Wol\Factory($loop);

$wolFactory->createSender()->then(function(Clue\React\Wol\Sender $wol) {
    $wol->send('11:22:33:44:55:66');
});

$loop->run();

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:, (*4)

$loop = React\EventLoop\Factory::create();
$wolFactory = new Clue\React\Wol\Factory($loop);

$wolFactory->createSender('1.2.3.4:9')->then(function(Clue\React\Wol\Sender $wol) {
    $wol->send('11:22:33:44:55:66');
});

$loop->run();

There's also a CLI script in bin/wol.php to send a WOL request from the command line simply by running:, (*5)

$ php bin/wol.php 11:22:33:44:55:66

Introduction

The following short introduction is mostly taken from wikipedia's article about WOL:, (*6)

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., (*7)

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., (*8)

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., (*9)

Install

The recommended way to install this library is through composer. New to composer?, (*10)

{
    "require": {
        "clue/wol-react": "0.1.*"
    }
}

License

MIT, (*11)

The Versions

09/03 2015

dev-master

9999999-dev https://github.com/clue/php-wake-on-lan-react

Turn on your PC with Wake-On-LAN (WOL) requests

  Sources   Download

MIT

The Requires

 

by Christian Lück

async reactphp wol wake on lan

11/05 2014

v0.1.0

0.1.0.0 https://github.com/clue/wol-reactphp

Turn on your PC with Wake-On-LAN (WOL) requests

  Sources   Download

MIT

The Requires

 

by Christian Lück

wol wake on lan