2019-09-06 23:53:10 +08:00

12 lines
271 B
PHP
Executable File

<?php
$cli = new swoole_http_client('127.0.0.1', 9501);
$cli->setHeaders(['Trace-Id' => md5(time()),]);
$cli->on('message', function ($_cli, $frame) {
var_dump($frame);
});
$cli->upgrade('/', function ($cli) {
echo $cli->body;
$cli->push("hello world");
});