{"id":31445936,"url":"https://github.com/zero-to-prod/stream-socket","last_synced_at":"2025-10-29T12:02:44.698Z","repository":{"id":256017406,"uuid":"854130514","full_name":"zero-to-prod/stream-socket","owner":"zero-to-prod","description":"A wrapper for stream_socket_client().","archived":false,"fork":false,"pushed_at":"2025-09-01T22:41:46.000Z","size":188,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-30T23:47:23.504Z","etag":null,"topics":["php","stream-socket"],"latest_commit_sha":null,"homepage":"https://zero-to-prod.github.io/stream-socket/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zero-to-prod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"zero-to-prod"}},"created_at":"2024-09-08T13:16:17.000Z","updated_at":"2025-09-01T22:41:48.000Z","dependencies_parsed_at":"2024-09-08T14:49:59.610Z","dependency_job_id":"8ee6a5fa-9f15-4a81-905e-fe4ced8f6ae8","html_url":"https://github.com/zero-to-prod/stream-socket","commit_stats":null,"previous_names":["zero-to-prod/stream-socket"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/zero-to-prod/stream-socket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-to-prod%2Fstream-socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-to-prod%2Fstream-socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-to-prod%2Fstream-socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-to-prod%2Fstream-socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zero-to-prod","download_url":"https://codeload.github.com/zero-to-prod/stream-socket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-to-prod%2Fstream-socket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281617488,"owners_count":26531925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","stream-socket"],"created_at":"2025-09-30T23:47:21.459Z","updated_at":"2025-10-29T12:02:44.660Z","avatar_url":"https://github.com/zero-to-prod.png","language":"PHP","readme":"# Zerotoprod\\StreamSocket\n\n![](./art/logo.png)\n\n[![Repo](https://img.shields.io/badge/github-gray?logo=github)](https://github.com/zero-to-prod/stream-socket)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/zero-to-prod/stream-socket/test.yml?label=test)](https://github.com/zero-to-prod/stream-socket/actions)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/zero-to-prod/stream-socket/backwards_compatibility.yml?label=backwards_compatibility)](https://github.com/zero-to-prod/stream-socket/actions)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/zero-to-prod/stream-socket?color=blue)](https://packagist.org/packages/zero-to-prod/stream-socket/stats)\n[![Packagist Version](https://img.shields.io/packagist/v/zero-to-prod/stream-socket?color=f28d1a)](https://packagist.org/packages/zero-to-prod/stream-socket)\n[![GitHub repo size](https://img.shields.io/github/repo-size/zero-to-prod/stream-socket)](https://github.com/zero-to-prod/stream-socket)\n[![License](https://img.shields.io/packagist/l/zero-to-prod/stream-socket?color=red)](https://github.com/zero-to-prod/stream-socket/blob/main/LICENSE.md)\n[![Hits-of-Code](https://hitsofcode.com/github/zero-to-prod/stream-socket?branch=main)](https://hitsofcode.com/github/zero-to-prod/stream-socket/view?branch=main)\n\n## Contents\n\n- [Introduction](#introduction)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Documentation Publishing](#documentation-publishing)\n  - [Automatic Documentation Publishing](#automatic-documentation-publishing)\n- [Usage](#usage)\n- [Local Development](./LOCAL_DEVELOPMENT.md)\n- [Contributing](#contributing)\n\n## Introduction\n\nA wrapper for the [`stream_socket_client()`](https://www.php.net/manual/en/function.stream-stream-socket.php) method.\n\nIt provides classes that define all the options for this method.\n\n## Requirements\n\n- PHP 7.1 or higher.\n\n## Installation\n\nInstall `Zerotoprod\\StreamSocket` via [Composer](https://getcomposer.org/):\n\n```shell\ncomposer require zero-to-prod/stream-socket\n```\n\nThis will add the package to your project’s dependencies and create an autoloader entry for it.\n\n## Documentation Publishing\n\nYou can publish this README to your local documentation directory.\n\nThis can be useful for providing documentation for AI agents.\n\nThis can be done using the included script:\n\n```bash\n# Publish to default location (./docs/zero-to-prod/stream-socket)\nvendor/bin/zero-to-prod-stream-socket\n\n# Publish to custom directory\nvendor/bin/zero-to-prod-stream-socket /path/to/your/docs\n```\n\n### Automatic Documentation Publishing\n\nYou can automatically publish documentation by adding the following to your `composer.json`:\n\n```json\n{\n  \"scripts\": {\n    \"post-install-cmd\": [\n      \"zero-to-prod-stream-socket\"\n    ],\n    \"post-update-cmd\": [\n      \"zero-to-prod-stream-socket\"\n    ]\n  }\n}\n```\n\n## Usage\n\n```php\nuse Zerotoprod\\StreamSocket\\StreamSocket;\n\nStreamSocket::client(\n    'ssl://'.$url.':'. 443,\n    30\n    STREAM_CLIENT_CONNECT,\n    stream_context_create()\n);\n\necho $SocketClient-\u003eremoteSocketName(); // 34.223.124.45:443\n\n$SocketClient-\u003eclose();\n```\n\n## Contributing\n\nContributions, issues, and feature requests are welcome!\nFeel free to check the [issues](https://github.com/zero-to-prod/stream-socket/issues) page if you want to contribute.\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature-branch`).\n3. Commit changes (`git commit -m 'Add some feature'`).\n4. Push to the branch (`git push origin feature-branch`).\n5. Create a new Pull Request.\n","funding_links":["https://github.com/sponsors/zero-to-prod"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero-to-prod%2Fstream-socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzero-to-prod%2Fstream-socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero-to-prod%2Fstream-socket/lists"}