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

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

realtime-php/websocket
======================

Package PHP pour le temps réel avec WebSockets

00PHP

Since Dec 29Pushed 4mo agoCompare

[ Source](https://github.com/mud-mos23/real-time-php)[ Packagist](https://packagist.org/packages/realtime-php/websocket)[ RSS](/packages/realtime-php-websocket/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

markdown

RealTime PHP WebSocket
======================

[](#realtime-php-websocket)

[![PHP Version](https://camo.githubusercontent.com/c3362351d1264fd924675776c4f8307bf5f229fa15cbbd49d020909278dadb3a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e342d626c7565)](https://camo.githubusercontent.com/c3362351d1264fd924675776c4f8307bf5f229fa15cbbd49d020909278dadb3a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e342d626c7565)[![License](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)[![WebSocket](https://camo.githubusercontent.com/04570d7333f3c5f7d96f47f97080ef55fb9787339a46ee00b350b19185ad12f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50726f746f636f6c2d576562536f636b65742d6f72616e6765)](https://camo.githubusercontent.com/04570d7333f3c5f7d96f47f97080ef55fb9787339a46ee00b350b19185ad12f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50726f746f636f6c2d576562536f636b65742d6f72616e6765)

Un package PHP moderne et puissant pour créer des applications temps réel avec WebSockets. Parfait pour les chats, les jeux en ligne, les tableaux de bord en temps réel et les systèmes de notification.

✨ Fonctionnalités
-----------------

[](#-fonctionnalités)

- ✅ **Serveur WebSocket haute performance** basé sur ReactPHP et Ratchet
- ✅ **Client WebSocket PHP &amp; JavaScript** inclus
- ✅ **Système d'événements** complet avec EventDispatcher
- ✅ **Gestion des salles/rooms** pour les groupes
- ✅ **Indicateur d'écriture** (Typing Indicator) en temps réel
- ✅ **Messages privés** et diffusion groupée
- ✅ **Authentification** intégrée
- ✅ **Gestion d'erreurs** robuste
- ✅ **Interface Messenger** complète incluse
- ✅ **Support Promises** pour les opérations asynchrones
- ✅ **Middleware** personnalisable
- ✅ **Design responsive** prêt pour mobile

📦 Installation
--------------

[](#-installation)

### Via Composer

[](#via-composer)

```
composer require mude_mos23/real-time-php
```

### Installation manuelle

[](#installation-manuelle)

```
git clone https://github.com/mude-mos23/real-time-php.git
cd real-time-php
composer install
```

🚀 Démarrage rapide

1. Créer un serveur WebSocket simple

```
php
on('connect', function($connection) {
    echo "Nouveau client connecté: " . $connection->getId();

    $connection->send([
        'event' => 'welcome',
        'data' => ['message' => 'Bienvenue!']
    ]);
});

// Gestion des messages
$server->on('message', function($connection, $data) use ($server) {
    $server->broadcast('new_message', [
        'from' => $connection->getId(),
        'message' => $data['message']
    ], [$connection->getId()]);
});

$server->start();
```

2. Créer un client PHP

```
php
connect();

$client->on('welcome', function($data) {
    echo "Message de bienvenue: " . $data['message'];
});

$client->emit('message', ['message' => 'Hello World!']);
```

3. Utiliser l'interface Messenger incluse

```
# Démarrer le serveur
php examples/chat-server.php

# Dans un autre terminal, démarrer le serveur web
php -S localhost:8000 -t examples/

# Ouvrir dans le navigateur
# http://localhost:8000/chat-client.html
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance51

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/aa20c759f465ea48c2a571a162c2c88e68592e952e89760e8c5ba6555628e1ec?d=identicon)[mud-mos23](/maintainers/mud-mos23)

---

Top Contributors

[![mud-mos23](https://avatars.githubusercontent.com/u/65009893?v=4)](https://github.com/mud-mos23 "mud-mos23 (6 commits)")

### Embed Badge

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

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

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

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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