PHPackages                             phrity/net-stream - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. phrity/net-stream

ActiveLibrary[HTTP &amp; Networking](/categories/http)

phrity/net-stream
=================

Socket stream classes implementing PSR-7 Stream and PSR-17 StreamFactory

2.4.0(4mo ago)55.2M↓23.3%32MITPHPPHP ^8.1CI passing

Since Dec 2Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/sirn-se/phrity-net-stream)[ Packagist](https://packagist.org/packages/phrity/net-stream)[ Docs](https://phrity.sirn.se/net-stream)[ RSS](/packages/phrity-net-stream/feed)WikiDiscussions main-v2 Synced 2w ago

READMEChangelog (10)Dependencies (17)Versions (17)Used By (2)

[![Phrity Net Stream](docs/logotype.png)](docs/logotype.png)

[![Build Status](https://github.com/sirn-se/phrity-net-stream/actions/workflows/acceptance.yml/badge.svg)](https://github.com/sirn-se/phrity-net-stream/actions)

Introduction
============

[](#introduction)

Package that provide implementations of [PSR-7 StreamInterface](https://www.php-fig.org/psr/psr-7/#34-psrhttpmessagestreaminterface)and [PSR-17 StreamFactoryInterface](https://www.php-fig.org/psr/psr-17/#24-streamfactoryinterface)but also adds stream and socket related funcitonality. It is designed for use with socket connections.

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

[](#installation)

Install with [Composer](https://getcomposer.org/);

```
composer require phrity/net-stream

```

Interfaces
----------

[](#interfaces)

- [StreamInterface](docs/StreamInterface.md) - Interface indicating a Stream implementation
- [StreamContainerInterface](docs/StreamContainerInterface.md) - Interface indicating a class containg a Stream

Included classes
----------------

[](#included-classes)

- [Context](docs/Context.md) - Stream context wrapper class
- [SocketClient](docs/SocketClient.md) - Socket Client that creates SocketStream connections
- [SocketServer](docs/SocketServer.md) - Socket Server that creates SocketStream connections
- [SocketStream](docs/SocketStream.md) - Extending Stream for additional methods
- [Stream](docs/Stream.md) - PSR-7 StreamFactory compatible Stream class
- [StreamCollection](docs/StreamCollection.md) - Collection of connections
- [StreamException](docs/StreamException.md) - Exception for stream related errors
- [StreamFactory](docs/StreamFactory.md) - PSR-17 StreamFactoryInterface compatible factory

Versions
--------

[](#versions)

VersionPHP`2.4``^8.1`StreamInterface, StreamContainerInterface`2.3``^8.1`Float timeout, hasContents method, Listeners`2.2``^8.1`Improved context handling`2.1``^8.0`Set context on server`2.0``^8.0`Modernization`1.3``^7.4|^8.0`Closing read and write separately`1.2``^7.4|^8.0`Socket client`1.1``^7.4|^8.0`Stream collection`1.0``^7.4|^8.0`Initial version

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance74

Regular maintenance activity

Popularity50

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 97.8% 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 ~86 days

Recently: every ~77 days

Total

15

Last Release

145d ago

Major Versions

1.3.0 → 2.0.02024-03-05

PHP version history (4 changes)1.0.0PHP ^7.4|^8.0

1.2.0PHP ^7.4 | ^8.0

2.0.0PHP ^8.0

2.2.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4255391?v=4)[Sören Jensen](/maintainers/sirn-se)[@sirn-se](https://github.com/sirn-se)

---

Top Contributors

[![sirn-se](https://avatars.githubusercontent.com/u/4255391?v=4)](https://github.com/sirn-se "sirn-se (88 commits)")[![AlboCode](https://avatars.githubusercontent.com/u/25480941?v=4)](https://github.com/AlboCode "AlboCode (1 commits)")[![hotfix31](https://avatars.githubusercontent.com/u/1555884?v=4)](https://github.com/hotfix31 "hotfix31 (1 commits)")

---

Tags

clientphpphp-librarypsr-17psr-7serversocketstreampsr-7streamclientpsr-17serverSocketstream factory

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phrity-net-stream/health.svg)

```
[![Health](https://phpackages.com/badges/phrity-net-stream/health.svg)](https://phpackages.com/packages/phrity-net-stream)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B4.4k](/packages/guzzlehttp-psr7)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28153.9k](/packages/phpro-http-tools)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

187738.3k49](/packages/laudis-neo4j-php-client)[sunrise/http-router

A powerful solution as the foundation of your project.

16852.3k12](/packages/sunrise-http-router)

PHPackages © 2026

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