PHPackages                             alexkratky/php-socketio - 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. alexkratky/php-socketio

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

alexkratky/php-socketio
=======================

PHP class to with Socket.io.

v1.0.0(6y ago)010MITPHPPHP &gt;=7.0

Since Apr 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/AlexKratky/PHPSocketIO)[ Packagist](https://packagist.org/packages/alexkratky/php-socketio)[ Docs](https://panx.eu/)[ RSS](/packages/alexkratky-php-socketio/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

PHPSocketIO
===========

[](#phpsocketio)

Class to work with realtime socket (Socket.io).

### Installation

[](#installation)

`composer require alexkratky/php-socketio`

### Usage

[](#usage)

```
require 'vendor/autoload.php';

use AlexKratky\PHPSocketIO;
$ip = "localhost";
$port = 8000;
$password = "password";
$secured = true; //https?
$channel = "room1";
$data = array(
    "ID" => 1,
    "name" => "Alex"
);

$socket = new PHPSocketIO($ip, $port, $password, $secured);
$socket->sendData($channel, $data);
```

### NodeJS implementation

[](#nodejs-implementation)

You can get inspired by NodeJS implementation by [here](https://github.com/AlexKratky/realtime-logger/blob/master/realtime-logger.js). In general, you need to handle HTTP POST requests.

```
var fs = require('fs');
var http = require('http');
var bodyParser = require("body-parser");
var express = require('express');
var app = express();
var port = 8000;

var urlencodedParser = bodyParser.urlencoded({ extended: false });
var webServer = http.createServer(app);
var io = require('socket.io').listen(webServer, { log: false });

app.post('/', urlencodedParser, function (req, res) {
    if (!req.body) return res.sendStatus(400);
    var post = req.body;
    if (post.password == config.password) {
        io.emit(post.channel, JSON.parse(post.data));
        res.send('true');
    } else {
        res.sendStatus(400);
    }
});
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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 ~12 days

Total

3

Last Release

2240d ago

Major Versions

v0.1.1 → v1.0.02020-05-14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33813757?v=4)[Alex Krátký](/maintainers/AlexKratky)[@AlexKratky](https://github.com/AlexKratky)

---

Top Contributors

[![AlexKratky](https://avatars.githubusercontent.com/u/33813757?v=4)](https://github.com/AlexKratky "AlexKratky (3 commits)")

---

Tags

phpSocketrealtimeSocket.io

### Embed Badge

![Health badge](/badges/alexkratky-php-socketio/health.svg)

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

###  Alternatives

[basement-chat/basement-chat

Add a real-time chat widget to your Laravel application.

4984.0k](/packages/basement-chat-basement-chat)[sockeon/sockeon

Framework-agnostic PHP WebSocket and HTTP server library with attribute-based routing and support for namespaces and rooms.

281.6k2](/packages/sockeon-sockeon)[soleon/sc-php

SocketCluster - PHP library for interacting with the SocketCluster.io

1633.7k](/packages/soleon-sc-php)[iris/nsq_to_swoole

a strong php client for NSQ using swoole extension

334.8k](/packages/iris-nsq-to-swoole)[warriorxk/phpwebsockets

A websocket library with support for IPC using socket pairs

1325.6k](/packages/warriorxk-phpwebsockets)

PHPackages © 2026

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