You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
11
vendor/swoole/examples/websocket/async_client.php
vendored
Executable file
11
vendor/swoole/examples/websocket/async_client.php
vendored
Executable file
@ -0,0 +1,11 @@
|
||||
<?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");
|
||||
});
|
Reference in New Issue
Block a user