PHPackages                             nadar/ratchetphp - 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. nadar/ratchetphp

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

nadar/ratchetphp
================

PHP WebSocket library (PHP 8.5 compatible fork of Ratchet)

1.1(1mo ago)018↓70.5%MITPHPPHP ^8.5CI passing

Since Jul 17Pushed 1mo agoCompare

[ Source](https://github.com/nadar/ratchetphp)[ Packagist](https://packagist.org/packages/nadar/ratchetphp)[ Docs](http://socketo.me)[ RSS](/packages/nadar-ratchetphp/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (9)Versions (6)Used By (0)

Ratchet (nadar fork)
====================

[](#ratchet-nadar-fork)

[![CI](https://github.com/nadar/ratchetphp/workflows/CI/badge.svg)](https://github.com/nadar/ratchetphp/actions?query=workflow%3ACI)[![Latest Stable Version](https://camo.githubusercontent.com/efd770bb56bd152554e62cef7aa6a1742d8c8b05a18c8978f272135fb0782d2b/68747470733a2f2f706f7365722e707567782e6f72672f6e616461722f726174636865747068702f76)](https://packagist.org/packages/nadar/ratchetphp)

A PHP library for asynchronously serving WebSockets. Build up your application through simple interfaces and re-use your application without changing any of its code just by combining different components.

> **About this fork**
>
> `nadar/ratchetphp` is a maintenance fork of [Ratchet](https://github.com/ratchetphp/Ratchet)focused on **PHP 8.5 compatibility**. PHP 8.5 deprecated the `SplObjectStorage`alias methods `attach()`, `detach()` and `contains()` in favour of the `ArrayAccess` methods `offsetSet()`, `offsetUnset()` and `offsetExists()`(see the [PHP 8.5 deprecations RFC](https://wiki.php.net/rfc/deprecations_php_8_5)). This fork replaces every deprecated call so running Ratchet on PHP 8.5 no longer emits deprecation notices. **This fork requires PHP 8.5.**
>
> ⚠️ **Switching the dependency is not enough.** The deprecated `SplObjectStorage` methods are typically also used in *your own* application code (the classic chat example keeps its clients in an `SplObjectStorage`), so `composer update` alone will not silence the deprecations — you have to update that code too. See **[UPGRADE.md](UPGRADE.md)** for the human guide and **[AGENTS.md](AGENTS.md)** for a checklist an AI agent can follow.

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

[](#installation)

```
composer require nadar/ratchetphp
```

Already using `plesk/ratchetphp` (or upstream Ratchet)? Read **[UPGRADE.md](UPGRADE.md)** first — you will need to update `SplObjectStorage`calls in your own code.

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

[](#requirements)

- PHP 8.5 or higher.

Shell access is required and root access is recommended. To avoid proxy/firewall blockage it's recommended WebSockets are requested on port 80 or 443 (SSL), which requires root access. In order to do this, along with your sync web stack, you can either use a reverse proxy or two separate machines. You can find more details in the [server conf docs](http://socketo.me/docs/deploy#server_configuration).

### Documentation

[](#documentation)

User and API documentation is available on Ratchet's website:

See  for some out-of-the-box working demos using Ratchet.

---

### A quick example

[](#a-quick-example)

```
