Async Simple Service Discovery Protocol (SSDP), built on top of React PHP.
As used in Univeral Plug and Play (UPnP). Commonly used by multimedia devices in home networks etc.
See UPnP device architecture definition (PDF). Uses Multicast and Unicast UDP HTTP messages (HTTPMU/HTTPU), expired IETF draft: https://tools.ietf.org/html/draft-goland-http-udp-01
This is an alternative to DNS-Based Service Discovery (DNS-SD) as defined in RFC 6763.
Note: This project is in early alpha stage! Feel free to report any issues you encounter.
Once installed, you can use the following code to search all available UPnP devices in your network:
$loop = React\EventLoop\Factory::create();
$client = new Client($loop);
$client->search()->then(
function () {
echo 'Search completed' . PHP_EOL;
},
function($e) {
echo 'There was an error searching for devices: ' . $e . PHP_EOL;
},
function ($progress) {
echo 'Found a device: ' . PHP_EOL;
var_dump($progress);
echo PHP_EOL;
}
);
$loop->run();See also the examples.
The recommended way to install this library is through composer. New to composer?
{
"require": {
"clue/ssdp-react": "dev-master"
}
}MIT