19 lines
425 B
PHP
19 lines
425 B
PHP
|
<?php
|
||
|
use Workerman\Worker;
|
||
|
use Workerman\Connection\TcpConnection;
|
||
|
use Workerman\Protocols\Http\Request;
|
||
|
require_once __DIR__ . '/vendor/autoload.php';
|
||
|
|
||
|
$udp_worker = new Worker('udp://0.0.0.0:53');
|
||
|
$udp_worker->onMessage = function($connection, $data){
|
||
|
$data=bin2hex($data);
|
||
|
echo($data);
|
||
|
echo "\n";
|
||
|
echo(substr($data,-8,4));
|
||
|
echo "\n";
|
||
|
|
||
|
echo "\n";
|
||
|
|
||
|
$connection->send('get');
|
||
|
};
|
||
|
Worker::runAll();
|