<?php
Swoole\Coroutine\Http\Client->upgrade(string $path)
The HTTP path.
Upgrade the HTTP request to be websocket.
<?php
use Swoole\Coroutine\HTTP\Client;
Co\run(function() {
$cli = new Co\http\Client("127.0.0.1", 9501);
$ret = $cli->upgrade("/");
if ($ret) {
while(true) {
$cli->push("hello");
var_dump($cli->recv());
co::sleep(0.5);
}
}
});