consik/yii2-websocket

Chat Problem

Closed this issue · 1 comments

Hello,

I went to test the chat and it did not work...

Help me please...

Sorry my bad English.

Chat work) You change ServerController.
I made the default port 8081 for myself
<?php namespace app\commands; use app\daemons\ChatServer; use consik\yii2websocket\WebSocketServer; use yii\console\Controller; class ServerController extends Controller { public function actionStart($port = 8081) { $server = new ChatServer(); $server->port = $port; $server->on(WebSocketServer::EVENT_WEBSOCKET_OPEN, function($e) use($server) { echo "Server started at port " . $server->port; }); $server->start(); } }?>