From 2702810e4bc2c8d56b80c42a816993995e4e6d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90=E5=B0=8F=E6=96=B0?= Date: Sat, 28 Mar 2020 18:04:34 +0800 Subject: [PATCH] style(some) --- .../Applications/githubT/start_gateway.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/GatewayWorker/Applications/githubT/start_gateway.php b/GatewayWorker/Applications/githubT/start_gateway.php index f8476f3..319cd43 100644 --- a/GatewayWorker/Applications/githubT/start_gateway.php +++ b/GatewayWorker/Applications/githubT/start_gateway.php @@ -50,23 +50,6 @@ $gateway->pingInterval = 10; // 心跳数据 $gateway->pingData = '{"type":"ping"}'; Worker::$daemonize = true; -/* -// 当客户端连接上来时,设置连接的onWebSocketConnect,即在websocket握手时的回调 -$gateway->onConnect = function($connection) -{ - $connection->onWebSocketConnect = function($connection , $http_header) - { - // 可以在这里判断连接来源是否合法,不合法就关掉连接 - // $_SERVER['HTTP_ORIGIN']标识来自哪个站点的页面发起的websocket链接 - if($_SERVER['HTTP_ORIGIN'] != 'http://kedou.workerman.net') - { - $connection->close(); - } - // onWebSocketConnect 里面$_GET $_SERVER是可用的 - // var_dump($_GET, $_SERVER); - }; -}; -*/ // 如果不是在根目录启动,则运行runAll方法 if(!defined('GLOBAL_START'))