vali 6 tahun lalu
induk
melakukan
504fa26ee1

+ 2 - 3
vendor/GatewayWorker_windows/Applications/whisper/start_gateway.php

@@ -38,7 +38,7 @@ $gateway->registerAddress = '127.0.0.1:1238';
 // 心跳间隔
 $gateway->pingInterval = 10;
 // 心跳数据
-$gateway->pingData = '{"type":"ping"}';
+$gateway->pingData = '{"message_type":"ping"}';
 
 
 // 当客户端连接上来时,设置连接的onWebSocketConnect,即在websocket握手时的回调
@@ -56,8 +56,7 @@ $gateway->onConnect = function ($connection) {
         }
         $_SESSION['remotip'] = $connection->getRemoteIp();
         $_SESSION['remotport'] = $connection->getRemotePort();
-        $_SESSION['userAgent'] = $_SERVER['HTTP_USER_AGENT'];
-        $_SESSION['origin'] = $_SERVER['HTTP_ORIGIN'];
+
 
         // 可以在这里判断连接来源是否合法,不合法就关掉连接
         // $_SERVER['HTTP_ORIGIN']标识来自哪个站点的页面发起的websocket链接