PHPackages                             kanata-php/conveyor-server-client - 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. kanata-php/conveyor-server-client

ActiveLibrary

kanata-php/conveyor-server-client
=================================

Server-Side WebSocket Client ready for Socket Conveyor

0.1.6(1y ago)0189↓100%2MITPHPPHP ^8.2

Since Sep 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kanata-php/conveyor-server-client)[ Packagist](https://packagist.org/packages/kanata-php/conveyor-server-client)[ GitHub Sponsors](https://github.com/kanata-php)[ RSS](/packages/kanata-php-conveyor-server-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (12)Used By (2)

[![](./imgs/logo.svg)](./imgs/logo.svg)

 [![Tests](https://github.com/kanata-php/conveyor-server-client/actions/workflows/php.yml/badge.svg)](https://github.com/kanata-php/conveyor-server-client/actions/workflows/php.yml)

> A server-side client for the php package [kanata-php/socket-conveyor](https://socketconveyor.com)

Prerequisites
-------------

[](#prerequisites)

- PHP &gt;= 8.0
- [PHP OpenSwoole Extension](https://openswoole.com/)

Install
-------

[](#install)

```
composer require kanata-php/conveyor-server-client
```

Description
-----------

[](#description)

This is a server-side client for the [Socket Conveyor](https://socketconveyor.com) PHP package.

Usage
-----

[](#usage)

Once installed, the following example shows how it works to use this package.

```
use Kanata\ConveyorServerClient\Client;

$options = [
    'onMessageCallback' => function(Client $currentClient, string $message) {
        echo 'Message received: ' . $message . PHP_EOL;
    },
];

$client = new Client($options);
$client->connect();
```

With the previous example you'll have a PHP script connected and waiting for messages to come. For each message received there will be a printed message in the terminal executing this script. This client will try to connect to `ws://127.0.0.1:8000`. To understand more Socket Conveyor channel and listeners you can head to its [documentation](https://socketconveyor.com).

> **Important:** this example doesn't have **timeout**. This means it will be running until its process gets killed. If you just need to listen for a limited time, or need a timeout for any other reason, use the `timeout` option.

This package has the following options (showing its respective defaults):

```
[
    /**
     * @var string
     */
    'protocol' => 'ws',

    /**
     * @var string
     */
    'uri' => '127.0.0.1',

    /**
     * @var int
     */
    'port' => 8000,

    /**
     * @var string
     */
    'query' => '',

    /**
     * @var ?string
     */
    'channel' =>  null,

    /**
     * @var ?string
     */
    'listen' => null,

    /**
     * @var ?callable
     */
    'onOpenCallback' => null,

    /**
     * @var ?callable
     */
    'onReadyCallback' => null,

    /**
     * Callback for incoming messages.
     * Passed parameters:
     *   - \WebSocket\Client $client
     *   - string $message
     *
     * @var ?callable
     */
    'onMessageCallback' => null,

    /**
     * Callback for disconnection.
     * Passed parameters:
     *   - \WebSocket\Client $client
     *   - int $reconnectionAttemptsCount
     *
     * @var ?callable
     */
    'onDisconnectCallback' => null,

    /**
     * Callback for Reconnection moment.
     * Passed parameters:
     *   - \WebSocket\Client $client
     *   - int \Throwable $e
     *
     * @var ?callable
     */
    'onReconnectionCallback' => null,

    /**
     * When positive, considered in seconds
     *
     * @var int
     */
    'timeout' => -1,

    /**
     * @var bool
     */
    'reconnect' => false;

    /**
     * Number of attempts if disconnects
     * For this to keeps trying forever, set it to -1.
     *
     * @var int
     */
    'reconnectionAttempts' => = 0;

    /**
     * Interval to reconnect in seconds
     *
     * @var int
     */
    'reconnectionInterval' => = 2;
]
```

This is this package's Conveyor Client interface:

```
namespace Kanata\ConveyorServerClient;

use WebSocket\Client;

interface ClientInterface
{
    public function connect(): void;
    public function getClient(): ?Client;
    public function close(): void;
    public function send(string $message): void;
    public function sendRaw(string $message): void;
}
```

Author
------

[](#author)

👤 **Savio Resende**

- Website:
- GitHub: [@lotharthesavior](https://github.com/lotharthesavior)

📝 License
---------

[](#-license)

Copyright © 2022 [Savio Resende](https://github.com/lotharthesavior).

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~73 days

Total

11

Last Release

586d ago

PHP version history (2 changes)0.0.1PHP ^8

0.1.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/90c2bdf7a2fb985ab0c72c842c4f7cbff79cb172deb85c06edf0bedceb3c9498?d=identicon)[lotharthesavior](/maintainers/lotharthesavior)

---

Top Contributors

[![lotharthesavior](https://avatars.githubusercontent.com/u/1092909?v=4)](https://github.com/lotharthesavior "lotharthesavior (23 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kanata-php-conveyor-server-client/health.svg)

```
[![Health](https://phpackages.com/badges/kanata-php-conveyor-server-client/health.svg)](https://phpackages.com/packages/kanata-php-conveyor-server-client)
```

###  Alternatives

[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[tivoka/tivoka

The universal JSON-RPC client/server library. JSON-RPC done right!

74159.0k3](/packages/tivoka-tivoka)[takielias/codeigniter-websocket

CodeIgniter Websocket using Ratchet Websocket technology. Inspired by https://github.com/romainrg/ratchet\_client

609.1k](/packages/takielias-codeigniter-websocket)[romainrg/ratchet_client

CodeIgniter library who allow you to make powerfull applications with realtime interactions by using Websocket technology

396.6k](/packages/romainrg-ratchet-client)[soleon/sc-php

SocketCluster - PHP library for interacting with the SocketCluster.io

1531.8k](/packages/soleon-sc-php)[jetsung/pusher

A message push extension.

168.6k](/packages/jetsung-pusher)

PHPackages © 2026

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