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(1mo ago)54.1M—7%32MITPHPPHP ^8.1CI passing

Since Dec 2Pushed 2mo 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 1mo 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

```

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.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

58

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity49

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity63

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

54d 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.0B3.2k](/packages/guzzlehttp-psr7)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[vultr/vultr-php

The Official Vultr API PHP Wrapper.

2243.9k1](/packages/vultr-vultr-php)[pdeans/http

PSR-7 cURL HTTP client with support for PSR-17 HTTP factories.

1466.2k3](/packages/pdeans-http)[amphp/http-client-psr7

PSR-7 adapter for Amp's HTTP client.

1454.7k4](/packages/amphp-http-client-psr7)

PHPackages © 2026

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