PHPackages                             jasonrgd/zf2-websocket-server-factory - 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. jasonrgd/zf2-websocket-server-factory

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

jasonrgd/zf2-websocket-server-factory
=====================================

ZF2 PHP WebSocket Server Factory v2.1 (Extended)

v2.2.1-stable(11y ago)024MITPHPPHP &gt;=5.4

Since Jun 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jasonrgd/ZF2-PHP-WebSocket-Server-Factory)[ Packagist](https://packagist.org/packages/jasonrgd/zf2-websocket-server-factory)[ Docs](https://github.com/stanislav-web/ZF2-PHP-WebSocket-Server-Factory)[ RSS](/packages/jasonrgd-zf2-websocket-server-factory/feed)WikiDiscussions master Synced 1mo ago

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

ZF2 PHP WebSocket Server Factory v2.2.1 (Extended) [![Latest Stable Version](https://camo.githubusercontent.com/fc4677a43d1589b0ded22ff5c31d0e7341975a90ea964b48bbbc096f16a0625c/68747470733a2f2f706f7365722e707567782e6f72672f7374616e69736c61762d7765622f7a66322d776562736f636b65742d7365727665722d666163746f72792f762f737461626c65)](https://packagist.org/packages/stanislav-web/zf2-websocket-server-factory)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#zf2-php-websocket-server-factory-v221-extended-)

[![Alt text](https://camo.githubusercontent.com/f4bbc6b3cac13c3c5ed16390784450c2b9c06eaf1cbc62d28fc35c4a1d5b19c1/68747470733a2f2f656e637279707465642d74626e322e677374617469632e636f6d2f696d616765733f713d74626e3a414e64394763527069323039755a7865557258503663464c787546627354516b6d395630616e54677037592d6c747045473673772d74786c7667 "WebSockets")](https://camo.githubusercontent.com/f4bbc6b3cac13c3c5ed16390784450c2b9c06eaf1cbc62d28fc35c4a1d5b19c1/68747470733a2f2f656e637279707465642d74626e322e677374617469632e636f6d2f696d616765733f713d74626e3a414e64394763527069323039755a7865557258503663464c787546627354516b6d395630616e54677037592d6c747045473673772d74786c7667)

Protocol WebSocket (standard RFC 6455) is designed to solve any problems and the removal of restrictions communication between browser and server.It allows you to transfer any data to any domain, safe and almost without unnecessary network traffic.

The main advantages of this module is that you can create a variety of applications based on Zend Framework 2, where it is necessary to implement persistent connections. Thanks to one interface, you can create a variety of applications and run them on the same server. You can organize a chat, monitor live site visit, you can create real-time statistics and save it to DB (MySQL, Mongo..etc), you can organize the postal service in the likeness of Google. Yes, anything!

#### Requirements

[](#requirements)

---

- PHP 5.4+
- [Zend Framework 2.4 &gt;](https://github.com/zendframework/zf2)

#### Changes

[](#changes)

---

v2.2.1 \[Request from [AdamiecRadek](https://github.com/AdamiecRadek)\]

- Added support for changing default application namespace
- Added support for multiple namespaces for applications
- Hotfix for proper index in config

v2.1.1

- Fixed service locator which is got ApplicationFactory v2.1
- Select client's application from console like `php -q index.php websocket open `

v2.0

- Add "Chat" application as example
- More advanced interface
- **Ability to create multiple applications and bind it to the same server**
- Detailed log of each ping server's
- The ability to set the maximum number of connections to the server, the maximum number of connections per IP
- Pre defined response errors for Linux, Win platforms (extended by their descriptions)
- Ping using control frames such as PING PONG

v1.3

- Add logger

v1.2

- Add verbose turner (debug show\\hide) (@see module.config.php)
- Add socket function's exception handler
- Fixed CLI stdout&gt;&gt; encoding
- Add ViewHelper for a simple get server config params into view

```

```

v1.1.2

- Console stdout&gt;&gt; while starting server

v1.1

- Fixes some problem with startup
- Add console command interface for costom system commands (for example) `php -q index.php websocket system "whoami"`(Note for ZF2.2): if you have an exceptions `Notice Undefined offset: 0` while starting console server please follow this:

`vendor\ZF2\library\Zend\Mvc\View\Console\RouteNotFoundStrategy.php` 381 and replace line by

```

```

It might be fixed until not fix in the next update. You're always can ask me for this module if you have write me [issue](https://github.com/stanislav-web/ZF2-PHP-WebSocket-Server-Factory/issues/1)

#### Installation and Running Server :

[](#installation-and-running-server-)

1. First update your dependencies through composer. Then run to update dependency and update autoloader

```
php composer.phar require stanislav-web/zf2-websocket-server-factory
php composer.phar install -o
```

2. That needs to be done is adding it to your application's list of active modules. Add module "WebSockets" in your application.config.php
3. Perform module configuration file module.config.php
4. Go to your shell command-line interface and type (running server as background): `php -q index.php websocket open ` (app like as your client application)
5. Setup your Client-side script's to communicating with the server .. ws://host:port/websocket/open/

#### How can i do the Application ?

[](#how-can-i-do-the-application-)

---

New application you can do according to the rules interface

```
src\WebSockets\Aware\ApplicationInterface.php

```

As an example, you can see the implementation "Chat"

```
src\WebSockets\Application\Chat.php

```

then call server from your cli controller

```

```

---

In order to start using the module clone the repo in your vendor directory or add it as a submodule if you're already using git for your project: `git clone https://github.com/stanislav-web/ZF2-PHP-WebSocket-Server-Factory.git vendor/WebSockets or git submodule add     git clone https://github.com/stanislav-web/ZF2-PHP-WebSocket-Server-Factory.git vendor/WebSockets`

The module will also be available as a Composer package soon.

#### Libraries used

[](#libraries-used)

- [Zend Framework 2.4](https://github.com/zendframework/zf2)
- \[WebSocket Protocol\] ()
- This repository is the continuation of the module from which I started work \[\] ()

[![Alt text](https://camo.githubusercontent.com/a52b3841b92c539fd9335b23af4af01c263d9545cc12cb5079c0b21ef8648eed/687474703a2f2f63646e2e6a6f78692e72752f75706c6f6164732f70726f642f323031342f30362f32362f3638622f3131312f353737633864303139376231646463366264376462376464653564303765666230303561653234622e6a7067 "WebSockets")](https://camo.githubusercontent.com/a52b3841b92c539fd9335b23af4af01c263d9545cc12cb5079c0b21ef8648eed/687474703a2f2f63646e2e6a6f78692e72752f75706c6f6164732f70726f642f323031342f30362f32362f3638622f3131312f353737633864303139376231646463366264376462376464653564303765666230303561653234622e6a7067)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.9% 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 ~327 days

Total

2

Last Release

4061d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1813407?v=4)[Jason Dsouza](/maintainers/jasonrgd)[@jasonrgd](https://github.com/jasonrgd)

---

Top Contributors

[![stanislav-web](https://avatars.githubusercontent.com/u/5216760?v=4)](https://github.com/stanislav-web "stanislav-web (34 commits)")[![jasonrgd](https://avatars.githubusercontent.com/u/1813407?v=4)](https://github.com/jasonrgd "jasonrgd (3 commits)")

---

Tags

WebSocketszf2websocket serverwebsocket chatwebsockets phpwebsocket php server

### Embed Badge

![Health badge](/badges/jasonrgd-zf2-websocket-server-factory/health.svg)

```
[![Health](https://phpackages.com/badges/jasonrgd-zf2-websocket-server-factory/health.svg)](https://phpackages.com/packages/jasonrgd-zf2-websocket-server-factory)
```

###  Alternatives

[slm/google-analytics

Google Analytics tracking integration for Zend Framework 2

4180.4k](/packages/slm-google-analytics)

PHPackages © 2026

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