PHPackages                             aki/yii2-socket - 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. aki/yii2-socket

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

aki/yii2-socket
===============

for yii2 web application

1324PHP

Since Oct 17Pushed 4y ago1 watchersCompare

[ Source](https://github.com/akbarjoudi/yii2-socket)[ Packagist](https://packagist.org/packages/aki/yii2-socket)[ RSS](/packages/aki-yii2-socket/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

 [![](https://camo.githubusercontent.com/afef20523561d628d14e2751917aeea1201abba2c96610b23c6fae0c2da7110f/68747470733a2f2f6e756c6c65642d736372697074732e69722f79696932776562736f636b65742e706e67)](https://camo.githubusercontent.com/afef20523561d628d14e2751917aeea1201abba2c96610b23c6fae0c2da7110f/68747470733a2f2f6e756c6c65642d736372697074732e69722f79696932776562736f636b65742e706e67)

for yii2 web application

Dependencies
------------

[](#dependencies)

```
"react/zmq": "^0.4.0"

```

The above library needs a (linux zmq.so) library

```
~$ sudo pecl install zmq-beta

```

and add extension to php.ini

```
~$ sudo nano /etc/php/apache2/php.ini

```

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer require aki/yii2-socket:dev-master

```

or add

```
"aki/yii2-socket": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

first add to config/console.php

```

```

Once the extension is installed, simply use it in your code by :

```
php yii socket --port=8083

```

Usage widget
------------

[](#usage-widget)

set config global in config.php

```
'container' => [
    'definitions' => [
        'aki\socket\widgets\SocketListener' => [
            'host' => "localhost",
            'port' => '8083',
	    'authModel' => app\models\User::class,
        ]
    ],
],
```

```
