zero-to-prod / stream-socket
A wrapper for stream_socket_client()
Fund package maintenance!
zero-to-prod
v71.0.2
2024-10-18 13:58 UTC
Requires
- php: ^7.1
- zero-to-prod/data-model: ^v71.2.0
Requires (Dev)
- phpunit/phpunit: ^7.0
Suggests
- zero-to-prod/stream-context: A wrapper for stream_context_create().
README
A wrapper for the stream_socket_client()
method.
It provides classes that define all the options for this method.
Installation
To install this package, add it to your composer.json file and run composer install:
composer require zerotoprod/stream-socket
Usage
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();