From db421edddbd72ed4bb77fda2a148eca4a26039a8 Mon Sep 17 00:00:00 2001 From: zhoudw <zhoudw@infobird.com> Date: Tue, 15 Mar 2022 17:30:24 +0800 Subject: [PATCH] 日志 --- .gitignore | 5 +---- runtime/container/proxy/App_Controller_WebsocketController.proxy.php | 2 ++ app/Controller/WebsocketController.php | 2 ++ runtime/hyperf.pid | 2 +- .env | 5 +++-- logs/ws-2022-03-15.log | 1 + config/autoload/server.php | 4 ++-- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.env b/.env index a2b93d5..6e40854 100644 --- a/.env +++ b/.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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index de5fc82..abe2d2d 100644 --- a/.gitignore +++ b/.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 +runtime/ \ No newline at end of file diff --git a/app/Controller/WebsocketController.php b/app/Controller/WebsocketController.php index 4f9fc70..9426e18 100644 --- a/app/Controller/WebsocketController.php +++ b/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; diff --git a/config/autoload/server.php b/config/autoload/server.php index 394c4e5..fa37445 100644 --- a/config/autoload/server.php +++ b/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'], diff --git a/logs/ws-2022-03-15.log b/logs/ws-2022-03-15.log new file mode 100644 index 0000000..30d74d2 --- /dev/null +++ b/logs/ws-2022-03-15.log @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/runtime/container/proxy/App_Controller_WebsocketController.proxy.php b/runtime/container/proxy/App_Controller_WebsocketController.proxy.php index bcce373..0d761bf 100644 --- a/runtime/container/proxy/App_Controller_WebsocketController.proxy.php +++ b/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; diff --git a/runtime/hyperf.pid b/runtime/hyperf.pid index 604fef2..a5a5efe 100644 --- a/runtime/hyperf.pid +++ b/runtime/hyperf.pid @@ -1 +1 @@ -1285 \ No newline at end of file +22692 \ No newline at end of file -- Gitblit v1.8.0