PHPackages                             johnrazeur/php-socket-io-event-emitter - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. johnrazeur/php-socket-io-event-emitter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

johnrazeur/php-socket-io-event-emitter
======================================

1.0.0(7y ago)028PHP

Since Apr 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/johnrazeur/php-socket-io-event-emitter)[ Packagist](https://packagist.org/packages/johnrazeur/php-socket-io-event-emitter)[ RSS](/packages/johnrazeur-php-socket-io-event-emitter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP Socket Client
=================

[](#php-socket-client)

Fork from : `https://github.com/psinetron/PHP_SocketIO_Client`

***install***

```
php composer require johnrazeur/php-socket-io-event-emitter

```

***Php***

```
require_once '../SocketIO.php';

$client = new SocketIO('localhost', 9001);

//connection handshake query( for auth - optional)
$client->setQueryParams([
    'token' => 'edihsudshuz',
    'id' => '8780',
    'cid' => '344',
    'cmp' => 2339
]);

$success = $client->emit('eventFromPhp', [
    'name' => 'Goku',
    'age' => '23',
    'address' => 'Sudbury, On, Canada'
]);

if(!$success)
{
    var_dump($client->getErrors());
}
else{
    var_dump("Success");
}
```

***Node Js***

```
var app = require('http').createServer(handler)
   var io = require('socket.io')(app);
   var fs = require('fs');

   app.listen(9001);

   function handler (req, res) {
       res.writeHead(200);
       res.end('Hello Word');
   }

   io.on('connection', function (socket) {

       console.log("New Connection with transport", socket.conn.transport.name);

       console.log('With handshake', socket.handshake);

       console.log('With query', socket.handshake.query);

       socket.on('eventFromPhp', function (data) {
           console.log('Data from Php', data, JSON.parse(data));
       });
   });

```

**2 - API**
-----------

[](#2---api)

***.`setMaxRetry(n)`***

```
$client->setMaxRetry(10);//default 5

```

***.`setRetryInterval(interval)`***

```
$client->setRetryInterval(100);// 100 ms, default 200

```

***.`setProtocole(protocol)`***

```
$client->setProtocole(SocketIO::NO_SECURE_PROTOCOLE);
$client->setProtocole(SocketIO::TLS_PROTOCOLE);
$client->setProtocole(SocketIO::SSL_PROTOCOLE);

```

***.`setPort(port)`***

```
$client->setPort(80);

```

***.`setPath(path)`***

```
$client->setPath('/socket.io/EIO=3');

```

***.`setHost(host)`***

```
$client->setPath('localhost');

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.2% 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

Unknown

Total

1

Last Release

2579d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0257647d3017f564034c9f2df7a16b0201c363da38c9059a102df3a0d70fee4e?d=identicon)[johnrazeur](/maintainers/johnrazeur)

---

Top Contributors

[![psinetron](https://avatars.githubusercontent.com/u/3624600?v=4)](https://github.com/psinetron "psinetron (15 commits)")[![touskar](https://avatars.githubusercontent.com/u/13134736?v=4)](https://github.com/touskar "touskar (6 commits)")[![bitkill](https://avatars.githubusercontent.com/u/5882528?v=4)](https://github.com/bitkill "bitkill (1 commits)")

### Embed Badge

![Health badge](/badges/johnrazeur-php-socket-io-event-emitter/health.svg)

```
[![Health](https://phpackages.com/badges/johnrazeur-php-socket-io-event-emitter/health.svg)](https://phpackages.com/packages/johnrazeur-php-socket-io-event-emitter)
```

###  Alternatives

[stuttter/wp-user-profiles

A sophisticated way to edit users in WordPress

11219.3k1](/packages/stuttter-wp-user-profiles)[fof/analytics

Tracks analytics using Google Analytics, Google Optimize/GTM and Matomo

3543.1k](/packages/fof-analytics)[chrico/wp-fields

Package which provides some re-usable fields for WordPress.

1981.2k](/packages/chrico-wp-fields)[aertmann/history

An improved history backend module for Neos

1070.2k](/packages/aertmann-history)

PHPackages © 2026

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