I have used SwooleClientAsync for async SSL TCP connections. Recently I've noticed that it is deprecated. So I have the following questions:
Thank you!
A: We just don’t develop new features, but if there are bugs, we will fix them, there is no end time
Yes, Here is the example
Co\run(function(){
$client = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP | SWOOLE_SSL);
if (!$client->connect('127.0.0.1', 9501, 0.5))
{
echo "connect failed. Error: {$client->errCode}\n";
}
$client->send("hello world\n");
echo $client->recv();
$client->close();
});
Async client will cause callback hell, Coroutine client is easier to use
Q: How long will it be supported?
A: We just don’t develop new features, but if there are bugs, we will fix them, there is no end time
Then why the documentation has been removed from the docs section? https://www.swoole.co.uk/docs/module. For example https://www.swoole.co.uk/docs/modules/swoole-client/methods async client methods list gives 404 error. We still use this client, so it would be good to keep the SwooleClientAsync documentation.
Also recent versions of ide-helper package don't include SwooleClientAsync helpers. So it looks like SwooleClientAsync is gone :(
Does SwooleCoroutineClient support SSL?
Yes, Here is the example
Co\run(function(){ $client = new Swoole\Coroutine\Client(SWOOLE_SOCK_TCP | SWOOLE_SSL); if (!$client->connect('127.0.0.1', 9501, 0.5)) { echo "connect failed. Error: {$client->errCode}\n"; } $client->send("hello world\n"); echo $client->recv(); $client->close(); });
Are there any options to control SSL behaviour? No such options mentioned in the docs. I'm using the following with SwooleClientAsync:
'ssl_verify_peer' => false,
'ssl_allow_self_signed' => true,
'ssl_verify_peer_name' => false,
'ssl_host_name' => $this->requestUri->getHost(),
'verify_peer' => false,
'allow_self_signed' => true,
'verify_peer_name' => false,
'timeout' => 20,
'debug_mode'=> DEBUG,
'keep_alive' => false,
'socket_buffer_size' => 16 * 1024 * 1024,
Are they supported?
@idealogica although async clients will be maintained and fixing the bugs, but we would recommend move to the coroutine client which is much more simple.
These SSL settings are still supported as is. We will update the docs soon.
Thank you so much for the responses and for updating the docs! :)
I have migrated successfully btw ;)
Most helpful comment
@idealogica although async clients will be maintained and fixing the bugs, but we would recommend move to the coroutine client which is much more simple.
These SSL settings are still supported as is. We will update the docs soon.