A wrapper for the stream_socket_client()
method.
It provides classes that define all the options for this method.
Install Zerotoprod\StreamSocket
via Composer:
composer require zero-to-prod/stream-socket
This will add the package to your project’s dependencies and create an autoloader entry for it.
use Zerotoprod\StreamSocket\StreamSocket;
StreamSocket::client(
'ssl://'.$url.':'. 443,
30
STREAM_CLIENT_CONNECT,
stream_context_create()
);
echo $SocketClient->remoteSocketName(); // 34.223.124.45:443
$SocketClient->close();
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
git checkout -b feature-branch
).git commit -m 'Add some feature'
).git push origin feature-branch
).