- Introduction
- Requirements
- Installation
- Documentation Publishing
- Usage
- Local Development
- Contributing
A wrapper for the stream_socket_client() method.
It provides classes that define all the options for this method.
- PHP 7.1 or higher.
Install Zerotoprod\StreamSocket via Composer:
composer require zero-to-prod/stream-socketThis will add the package to your project’s dependencies and create an autoloader entry for it.
You can publish this README to your local documentation directory.
This can be useful for providing documentation for AI agents.
This can be done using the included script:
# Publish to default location (./docs/zero-to-prod/stream-socket)
vendor/bin/zero-to-prod-stream-socket
# Publish to custom directory
vendor/bin/zero-to-prod-stream-socket /path/to/your/docsYou can automatically publish documentation by adding the following to your composer.json:
{
"scripts": {
"post-install-cmd": [
"zero-to-prod-stream-socket"
],
"post-update-cmd": [
"zero-to-prod-stream-socket"
]
}
}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.
- 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.
