zero-to-prod / stream-socket
A wrapper for stream_socket_client()
Fund package maintenance!
Github
Requires
- php: >=7.1
- zero-to-prod/data-model: ^v71.2.0
- zero-to-prod/dock: ^1.0
Requires (Dev)
Suggests
- zero-to-prod/stream-context: A wrapper for stream_context_create().
README
Contents
Introduction
A wrapper for the stream_socket_client()
method.
It provides classes that define all the options for this method.
Requirements
- PHP 7.1 or higher.
Installation
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.
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();
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.