mirror of
https://github.com/YGGverse/nex-php.git
synced 2026-03-31 17:55:31 +00:00
fix handler function response
This commit is contained in:
parent
9daef40268
commit
52b43a252d
2 changed files with 12 additions and 1 deletions
|
|
@ -73,12 +73,15 @@ $server->start(
|
||||||
function (
|
function (
|
||||||
string $request,
|
string $request,
|
||||||
string $connect
|
string $connect
|
||||||
) {
|
): ?string
|
||||||
|
{
|
||||||
printf(
|
printf(
|
||||||
'connection: %s request: %s',
|
'connection: %s request: %s',
|
||||||
$connect,
|
$connect,
|
||||||
$request
|
$request
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return null; // null|string response
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,14 @@ class Server
|
||||||
$request,
|
$request,
|
||||||
$connect
|
$connect
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($response)
|
||||||
|
{
|
||||||
|
fwrite(
|
||||||
|
$incoming,
|
||||||
|
$response
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(
|
fclose(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue