zhoudw
2022-03-15 db421edddbd72ed4bb77fda2a148eca4a26039a8
日志
6 files modified
1 files added
19 ■■■■■ changed files
.env 5 ●●●●● patch | view | raw | blame | history
.gitignore 3 ●●●●● patch | view | raw | blame | history
app/Controller/WebsocketController.php 2 ●●●●● patch | view | raw | blame | history
config/autoload/server.php 4 ●●●● patch | view | raw | blame | history
logs/ws-2022-03-15.log 1 ●●●● patch | view | raw | blame | history
runtime/container/proxy/App_Controller_WebsocketController.proxy.php 2 ●●●●● patch | view | raw | blame | history
runtime/hyperf.pid 2 ●●● patch | view | raw | blame | history
.env
@@ -11,7 +11,8 @@
DB_COLLATION=utf8mb4_unicode_ci
DB_PREFIX=
REDIS_HOST=120.25.156.26
REDIS_HOST=120.76.101.87
REDIS_AUTH=(null)
REDIS_PORT=56379
REDIS_PORT=51101
REDIS_DB=0
ALLIW_IP=120.25.156.26.58004
.gitignore
@@ -1,6 +1,3 @@
composer.phar
vendor/
runtime/
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
app/Controller/WebsocketController.php
@@ -90,6 +90,7 @@
            switch ($action)
            {
            case "reg":
                $this->logger->info('reg',$frameData);
                $groupId = $data['group_id'];
                $session = $data['session_id'];
                $this->bind($groupId,'',$frame->fd);
@@ -111,6 +112,7 @@
                $server->push($frame->fd, json_encode($ret));
                break;
            case "data":
                $this->logger->info('data',$frameData);
                $groupId = $data['group_id'];
                $ret['event'] = "data";
                $ret['data']  = $data;
config/autoload/server.php
@@ -21,9 +21,9 @@
            'name' => 'ws',
            'type' => Server::SERVER_WEBSOCKET,
            'host' => '0.0.0.0',
            'port' => 9502,
            'port' => 9501,
            'sock_type' => SWOOLE_SOCK_TCP,
            'allow_ip' => '120.25.156.26.58005',
            'allow_ip' => env('ALLIW_IP','127.0.0.1:9502'),
            'callbacks' => [
                SwooleEvent::ON_HAND_SHAKE => [Hyperf\WebSocketServer\Server::class, 'onHandShake'],
                SwooleEvent::ON_MESSAGE => [Hyperf\WebSocketServer\Server::class, 'onMessage'],
logs/ws-2022-03-15.log
New file
@@ -0,0 +1 @@
test
runtime/container/proxy/App_Controller_WebsocketController.proxy.php
@@ -84,6 +84,7 @@
            $action = substr($url, strrpos($url, "/") + 1);
            switch ($action) {
                case "reg":
                    $this->logger->info('reg', $frameData);
                    $groupId = $data['group_id'];
                    $session = $data['session_id'];
                    $this->bind($groupId, '', $frame->fd);
@@ -105,6 +106,7 @@
                    $server->push($frame->fd, json_encode($ret));
                    break;
                case "data":
                    $this->logger->info('data', $frameData);
                    $groupId = $data['group_id'];
                    $ret['event'] = "data";
                    $ret['data'] = $data;
runtime/hyperf.pid
@@ -1 +1 @@
1285
22692