swoole_http_client->upgrade

����WebSocket�������󣬲�����������ΪWebSocket��

function swoole_http_client->upgrade(string $path, callable $callback);

ʹ��ʵ��

$cli = new swoole_http_client('127.0.0.1', 9501);

$cli->on('message', function ($_cli, $frame) {
    var_dump($frame);
});

$cli->upgrade('/', function ($cli) {
    echo $cli->body;
    $cli->push("hello world");
});

onMessage�ص�

function onMessage(swoole_http_client $client, swoole_websocket_frame $frame);