quangthinh/yii2-sio

1.0 2017-05-25 14:44 UTC

This package is not auto-updated.

Last update: 2024-05-12 00:58:30 UTC


README

socket.io emitter

Install

composer require quangthinh/yii2-sio

Add to Component section at config file

        'sio' => [
            'class' => 'quangthinh\yii\sio\Connection',
            'redis' => [
                'class' => 'yii\redis\Connection',
                'hostname' => 'localhost',
                'port' => 6379,
                'database' => 0,
            ],
        ],

Usage

port of socket.io-emitter

Yii::$app->sio
  ->to("ROOM_ID")
  ->emit("EVENT", "MSG", ...)