peterliu
peterliu
Try the codes. ```php $io->of('/users')->on('connection', static function($socket) { echo 'OK'; }); ```
For example. use Workerman/Protocols/Http/Response; // ..... return new Response(200, [“ Content-Type” => “ application/json”], json_encode($data));
For example. ```php use Workerman\Protocols\Http\Response; $api->get('/img/{file}', function ($request, $file) { $file = __DIR__ . '/img/' . $file; return (new Response())->withFile($file); }); ```
Mark use FastRoute as route manager. Here is the document https://github.com/nikic/FastRoute#defining-routes.
Use `-k` For example `ab -n100000 -c100 -k https://127.0.0.1:3000/`
Hi carlok. Use `$request->post()` or `$request->rawBody()` to accessing post request payload.