PHPackages                             zero-to-prod/stream-socket-cli - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. zero-to-prod/stream-socket-cli

ActiveLibrary

zero-to-prod/stream-socket-cli
==============================

A CLI for a stream socket.

v1.1.0(1y ago)12651MITPHPPHP &gt;=8.1CI passing

Since Jan 28Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/stream-socket-cli)[ Packagist](https://packagist.org/packages/zero-to-prod/stream-socket-cli)[ Docs](https://github.com/zero-to-prod/stream-socket-cli)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-stream-socket-cli/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (1)

Zerotoprod\\StreamSocketCli
===========================

[](#zerotoprodstreamsocketcli)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/stream-socket-cli)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/c92b3365d77bef7071632d5c432aacb7208f0162afe6ac502a7cd5fb9ec3a7e8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f73747265616d2d736f636b65742d636c692f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/stream-socket-cli/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/a9c3685e87aa6ccbaea941d68a0d746a738896e93491587336c7fcccd09c1420/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f73747265616d2d736f636b65742d636c692f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/stream-socket-cli/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/2576e76a6c1f4b14566104a9f2ac1ca98fd2951e56f520a6e9c7b8c9bf25de43/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f73747265616d2d736f636b65742d636c692f6275696c645f646f636b65725f696d6167652e796d6c3f6c6162656c3d6275696c645f646f636b65725f696d616765)](https://github.com/zero-to-prod/stream-socket-cli/actions)[![Packagist Downloads](https://camo.githubusercontent.com/107300d15ab6879f3a6de7b062593deca6fc404789dbefcac78e83fab68ebe85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f73747265616d2d736f636b65742d636c693f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/stream-socket-cli/stats)[![php](https://camo.githubusercontent.com/4e5d192e938f5a6772bcb0de2c9c02eae6b8c13435390eab756353e9a760368a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a65726f2d746f2d70726f642f73747265616d2d736f636b65742d636c692e7376673f636f6c6f723d707572706c65)](https://packagist.org/packages/zero-to-prod/stream-socket-cli/stats)[![Packagist Version](https://camo.githubusercontent.com/9bd920a34dede69fc912809c30b839c97bffe3175aafcfa5bf15a0a8deb31222/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f73747265616d2d736f636b65742d636c693f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/stream-socket-cli)[![License](https://camo.githubusercontent.com/49b3a28200d02a1c0c01de2c7d23a58c52b3000d4a3500c7826a7d79fc347b2d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f73747265616d2d736f636b65742d636c693f636f6c6f723d70696e6b)](https://github.com/zero-to-prod/stream-socket-cli/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/799c1c1a9df383b7de9d0a9b06dc3232320b539b1d9b1d4c41aeb90b18f68617/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f73747265616d2d736f636b65742d636c692e737667)](https://wakatime.com/badge/github/zero-to-prod/stream-socket-cli)[![Hits-of-Code](https://camo.githubusercontent.com/70e61d8be13be64dca333aae20d520a3457825ded35dbb242df5a9cdafc77ee0/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f73747265616d2d736f636b65742d636c693f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/stream-socket-cli/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
    - [Available Commands](#available-commands)
        - [`stream-socket-cli:src`](#stream-socket-clisrc)
        - [`stream-socket-cli:remote-socket-name`](#stream-socket-cliremote-socket-name)
        - [`stream-socket-cli:local-socket-name`](#stream-socket-clilocal-socket-name)
        - [`stream-socket-cli:send-to`](#stream-socket-clisend-to)
        - [`stream-socket-cli:supports-lock`](#stream-socket-clisupports-lock)
        - [`stream-socket-cli:get-options`](#stream-socket-cliget-options)
- [Docker Image](#docker-image)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Image Development](./IMAGE_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

A CLI for a stream socket.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher.

Installation
------------

[](#installation)

Install `Zerotoprod\StreamSocketCli` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/stream-socket-cli
```

This will add the package to your project's dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

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-cli)
vendor/bin/zero-to-prod-stream-socket-cli

# Publish to custom directory
vendor/bin/zero-to-prod-stream-socket-cli /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-stream-socket-cli"
        ],
        "post-update-cmd": [
            "zero-to-prod-stream-socket-cli"
        ]
    }
}
```

Usage
-----

[](#usage)

Run this command to see the available commands:

```
vendor/bin/stream-socket-cli list
```

### Available Commands

[](#available-commands)

#### `stream-socket-cli:src`

[](#stream-socket-clisrc)

Displays the project's GitHub repository URL.

**Usage:**

```
vendor/bin/stream-socket-cli stream-socket-cli:src
```

**Example:**

```
vendor/bin/stream-socket-cli stream-socket-cli:src
```

**Output:**

```
https://github.com/zero-to-prod/stream-socket-cli

```

#### `stream-socket-cli:remote-socket-name`

[](#stream-socket-cliremote-socket-name)

Returns the remote socket name for a given URL connection.

**Usage:**

```
vendor/bin/stream-socket-cli stream-socket-cli:remote-socket-name
```

**Arguments:**

- `url` (required): The URL to connect to

**Example:**

```
vendor/bin/stream-socket-cli stream-socket-cli:remote-socket-name ssl://google.com:443
```

**Output:**

```
74.125.224.102:443

```

#### `stream-socket-cli:local-socket-name`

[](#stream-socket-clilocal-socket-name)

Returns the local socket name for a given URL connection.

**Usage:**

```
vendor/bin/stream-socket-cli stream-socket-cli:local-socket-name
```

**Arguments:**

- `url` (required): The URL to connect to

**Example:**

```
vendor/bin/stream-socket-cli stream-socket-cli:local-socket-name ssl://google.com:443
```

**Output:**

```
192.168.1.100:52345

```

#### `stream-socket-cli:send-to`

[](#stream-socket-clisend-to)

Sends a message to a socket, whether it is connected or not.

**Usage:**

```
vendor/bin/stream-socket-cli stream-socket-cli:send-to   [--flags] [--address]
```

**Arguments:**

- `url` (required): The URL to connect to
- `data` (required): The data to be sent

**Options:**

- `--flags`: The value of flags can be any combination of the following: STREAM\_OO
- `--address`: The address specified when the socket stream was created will be used unless an alternate address is specified in address. If specified, it must be in dotted quad (or \[ipv6\]) format

**Example:**

```
vendor/bin/stream-socket-cli stream-socket-cli:send-to tcp://httpbin.org:80 "GET / HTTP/1.1\r\nHost: httpbin.org\r\n\r\n"
```

**Output:**

```
42

```

#### `stream-socket-cli:supports-lock`

[](#stream-socket-clisupports-lock)

Tells whether the stream supports locking. Returns the URL for true, otherwise returns an empty string.

**Usage:**

```
vendor/bin/stream-socket-cli stream-socket-cli:supports-lock
```

**Arguments:**

- `url` (required): The URL to connect to

**Example:**

```
vendor/bin/stream-socket-cli stream-socket-cli:supports-lock ssl://google.com:443
```

**Output (if supports locking):**

```
ssl://google.com:443

```

**Output (if doesn't support locking):**

```

```

#### `stream-socket-cli:get-options`

[](#stream-socket-cliget-options)

Retrieve options for a stream/wrapper/context.

**Usage:**

```
vendor/bin/stream-socket-cli stream-socket-cli:get-options
```

**Arguments:**

- `url` (required): The URL to connect to

**Example:**

```
vendor/bin/stream-socket-cli stream-socket-cli:get-options ssl://google.com:443
```

**Output:**

```
{
    "ssl": {
        "peer_name": "google.com",
        "verify_peer": true,
        "verify_peer_name": true
    }
}
```

Docker Image
------------

[](#docker-image)

You can also run the cli using the [docker image](https://hub.docker.com/repository/docker/davidsmith3/stream-socket-cli/general):

```
docker run --rm davidsmith3/stream-socket-cli
```

Contributing
------------

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/stream-socket-cli/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance52

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

476d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (16 commits)")

---

Tags

zero-to-prodstream-socket-cli

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-stream-socket-cli/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-stream-socket-cli/health.svg)](https://phpackages.com/packages/zero-to-prod-stream-socket-cli)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14226.2k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
