PHPackages                             textalk/websocket - 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. textalk/websocket

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

textalk/websocket
=================

WebSocket client and server

1.6.3(3y ago)96818.7M↓19.8%254[6 issues](https://github.com/Textalk/websocket-php/issues)[4 PRs](https://github.com/Textalk/websocket-php/pulls)20ISCPHPPHP ^7.4 | ^8.0

Since May 30Pushed 7mo ago38 watchersCompare

[ Source](https://github.com/Textalk/websocket-php)[ Packagist](https://packagist.org/packages/textalk/websocket)[ RSS](/packages/textalk-websocket/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (34)Used By (20)

Websocket Client and Server for PHP
===================================

[](#websocket-client-and-server-for-php)

[![Build Status](https://github.com/Textalk/websocket-php/actions/workflows/acceptance.yml/badge.svg)](https://github.com/Textalk/websocket-php/actions)[![Coverage Status](https://camo.githubusercontent.com/0cd2e339550291ccb3118c83248ab6ad2643ae7ce0bd8ce43d21a2d570271296/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f54657874616c6b2f776562736f636b65742d7068702f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Textalk/websocket-php)

Archived project
----------------

[](#archived-project)

This project has been archived and is no longer maintained. No bug fix and no additional features will be added.
You won't be able to submit new issues or pull requests, and no additional features will be added

This library has been replaced by [sirn-se/websocket-php](https://github.com/sirn-se/websocket-php)

Websocket Client and Server for PHP
-----------------------------------

[](#websocket-client-and-server-for-php-1)

This library contains WebSocket client and server for PHP.

The client and server provides methods for reading and writing to WebSocket streams. It does not include convenience operations such as listeners and implicit error handling.

Documentation
-------------

[](#documentation)

- [Client](docs/Client.md)
- [Server](docs/Server.md)
- [Examples](docs/Examples.md)
- [Changelog](docs/Changelog.md)
- [Contributing](docs/Contributing.md)

Installing
----------

[](#installing)

Preferred way to install is with [Composer](https://getcomposer.org/).

```
composer require textalk/websocket

```

- Current version support PHP versions `^7.4|^8.0`.
- For PHP `7.2` and `7.3` support use version [`1.5`](https://github.com/Textalk/websocket-php/tree/1.5.0).
- For PHP `7.1` support use version [`1.4`](https://github.com/Textalk/websocket-php/tree/1.4.0).
- For PHP `^5.4` and `7.0` support use version [`1.3`](https://github.com/Textalk/websocket-php/tree/1.3.0).

Client
------

[](#client)

The [client](docs/Client.md) can read and write on a WebSocket stream. It internally supports Upgrade handshake and implicit close and ping/pong operations.

```
$client = new WebSocket\Client("ws://echo.websocket.org/");
$client->text("Hello WebSocket.org!");
echo $client->receive();
$client->close();
```

Server
------

[](#server)

The library contains a rudimentary single stream/single thread [server](docs/Server.md). It internally supports Upgrade handshake and implicit close and ping/pong operations.

Note that it does **not** support threading or automatic association ot continuous client requests. If you require this kind of server behavior, you need to build it on top of provided server implementation.

```
$server = new WebSocket\Server();
$server->accept();
$message = $server->receive();
$server->text($message);
$server->close();
```

### License and Contributors

[](#license-and-contributors)

[ISC License](COPYING.md)

Fredrik Liljegren, Armen Baghumian Sankbarani, Ruslan Bekenev, Joshua Thijssen, Simon Lipp, Quentin Bellus, Patrick McCarren, swmcdonnell, Ignas Bernotas, Mark Herhold, Andreas Palm, Sören Jensen, pmaasz, Alexey Stavrov, Michael Slezak, Pierre Seznec, rmeisler, Nickolay V. Shmyrev, Christoph Kempen, Marc Roberts, Antonio Mora, Simon Podlipsky, etrinh.

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance44

Moderate activity, may be stable

Popularity72

Solid adoption and visibility

Community51

Growing community involvement

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 75.4% 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 ~110 days

Recently: every ~49 days

Total

29

Last Release

1288d ago

Major Versions

0.1.1 → 1.0.02014-10-28

PHP version history (4 changes)1.3.0PHP ^5.4|^7.0

1.4.0PHP ^7.1

1.5.0PHP ^7.2 | ^8.0

1.6.0PHP ^7.4 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/239677ac812c8b17c82d1b925b90c6caffa1b5ddf01c332a3479b5fe37e890c1?d=identicon)[fiddur](/maintainers/fiddur)

---

Top Contributors

[![sirn-se](https://avatars.githubusercontent.com/u/4255391?v=4)](https://github.com/sirn-se "sirn-se (178 commits)")[![pmccarren](https://avatars.githubusercontent.com/u/4959702?v=4)](https://github.com/pmccarren "pmccarren (14 commits)")[![fiddur](https://avatars.githubusercontent.com/u/148166?v=4)](https://github.com/fiddur "fiddur (11 commits)")[![slezakattack](https://avatars.githubusercontent.com/u/1261638?v=4)](https://github.com/slezakattack "slezakattack (3 commits)")[![larsgust](https://avatars.githubusercontent.com/u/97449892?v=4)](https://github.com/larsgust "larsgust (3 commits)")[![zapling](https://avatars.githubusercontent.com/u/15123086?v=4)](https://github.com/zapling "zapling (2 commits)")[![Logioniz](https://avatars.githubusercontent.com/u/1052312?v=4)](https://github.com/Logioniz "Logioniz (2 commits)")[![rmeisler-applovin](https://avatars.githubusercontent.com/u/99207377?v=4)](https://github.com/rmeisler-applovin "rmeisler-applovin (2 commits)")[![marcroberts](https://avatars.githubusercontent.com/u/43874?v=4)](https://github.com/marcroberts "marcroberts (2 commits)")[![amorAaluxion](https://avatars.githubusercontent.com/u/68215455?v=4)](https://github.com/amorAaluxion "amorAaluxion (1 commits)")[![RaoH](https://avatars.githubusercontent.com/u/738935?v=4)](https://github.com/RaoH "RaoH (1 commits)")[![rmeisler](https://avatars.githubusercontent.com/u/1885391?v=4)](https://github.com/rmeisler "rmeisler (1 commits)")[![RobQuistNL](https://avatars.githubusercontent.com/u/1442796?v=4)](https://github.com/RobQuistNL "RobQuistNL (1 commits)")[![simPod](https://avatars.githubusercontent.com/u/327717?v=4)](https://github.com/simPod "simPod (1 commits)")[![sloonz](https://avatars.githubusercontent.com/u/142145?v=4)](https://github.com/sloonz "sloonz (1 commits)")[![swmcdonnell](https://avatars.githubusercontent.com/u/6199058?v=4)](https://github.com/swmcdonnell "swmcdonnell (1 commits)")[![vkuptcov](https://avatars.githubusercontent.com/u/1507196?v=4)](https://github.com/vkuptcov "vkuptcov (1 commits)")[![waldyrious](https://avatars.githubusercontent.com/u/478237?v=4)](https://github.com/waldyrious "waldyrious (1 commits)")[![webpatser](https://avatars.githubusercontent.com/u/25720?v=4)](https://github.com/webpatser "webpatser (1 commits)")[![QuentinBellus](https://avatars.githubusercontent.com/u/7331499?v=4)](https://github.com/QuentinBellus "QuentinBellus (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/textalk-websocket/health.svg)

```
[![Health](https://phpackages.com/badges/textalk-websocket/health.svg)](https://phpackages.com/packages/textalk-websocket)
```

###  Alternatives

[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

536204.9M23](/packages/league-uri-interfaces)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[phrity/websocket

WebSocket client and server

2184.1M27](/packages/phrity-websocket)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[mimmi20/browser-detector

Library to detect Browsers and Devices

48153.5k3](/packages/mimmi20-browser-detector)[api-platform/metadata

API Resource-oriented metadata attributes and factories

243.5M96](/packages/api-platform-metadata)

PHPackages © 2026

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