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

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

r-martins/php-websocket
=======================

A simple WebSocket Server and Client implementation in PHP.

v3.1.1(4y ago)014MITPHPPHP ^7.4|^8.0

Since Apr 5Pushed 4y agoCompare

[ Source](https://github.com/r-martins/php-websocket)[ Packagist](https://packagist.org/packages/r-martins/php-websocket)[ Docs](https://bloatless.org)[ RSS](/packages/r-martins-php-websocket/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (12)Used By (0)

 [![](https://camo.githubusercontent.com/c32f73a2d2e53972aa4187a1ffa7e720e107f2a72a7a1f1e4e4a8737eab4338e/68747470733a2f2f626c6f61746c6573732e6f72672f696d672f6c6f676f2e737667)](https://camo.githubusercontent.com/c32f73a2d2e53972aa4187a1ffa7e720e107f2a72a7a1f1e4e4a8737eab4338e/68747470733a2f2f626c6f61746c6573732e6f72672f696d672f6c6f676f2e737667)

Bloatless PHP WebSockets
========================

[](#bloatless-php-websockets)

 Simple WebSocket server implemented in PHP.

- [Installation](#installation)
    - [Requirements](#requirements)
    - [Installation procedure](#installation-procedure)
- [Usage](#usage)
    - [Server](#server)
    - [Applications](#applications)
    - [Timers](#timers)
    - [Push-Client (IPC)](#push-client-ipc)
    - [Client (Browser/JS)](#client-browserjs)
- [Intended use and limitations](#intended-use-and-limitations)
- [Alternatives](#alternatives)
- [License](#license)

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

[](#installation)

### Requirements

[](#requirements)

- PHP &gt;= 7.4
- ext-json
- ext-sockets

### Installation procedure

[](#installation-procedure)

Install the package using composer:

`composer require bloatless/php-websocket`

Usage
-----

[](#usage)

### Server

[](#server)

After downloading the sourcecode to your machine, you need some code to actually put your websocket server together. Here is a basic exmaple:

```
