Initial commit
This commit is contained in:
13
examples/get-gateway-ip.php
Normal file
13
examples/get-gateway-ip.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
use NoccyLabs\UPnP\SSDP\Discovery;
|
||||
use NoccyLabs\UPnP\SSDP\SearchTarget;
|
||||
|
||||
$discovery = new Discovery();
|
||||
$discovery->discover(SearchTarget::URN_SCHEMA_DEVICE_IGD_2);
|
||||
|
||||
foreach ($discovery as $device) {
|
||||
echo "Gateway IP: ".$device->getIp()."\n";
|
||||
}
|
Reference in New Issue
Block a user