shish 6 سال پیش
والد
کامیت
5cdfc7b014
1فایلهای تغییر یافته به همراه0 افزوده شده و 5 حذف شده
  1. 0 5
      vendor/workerman/GatewayWorker/Applications/retail/start_gateway.php

+ 0 - 5
vendor/workerman/GatewayWorker/Applications/retail/start_gateway.php

@@ -45,14 +45,9 @@ $gateway->onConnect = function ($connection) {
 	$connection->onWebSocketConnect = function ($connection, $http_header) {
 		// 可以在这里判断连接来源是否合法,不合法就关掉连接
 		// $_SERVER['HTTP_ORIGIN']标识来自哪个站点的页面发起的websocket链接
-		if ($_SERVER['HTTP_ORIGIN'] != 'http://huahb.com') {
-			//$connection->close();
-		}
-
 		if (strpos($_SERVER['HTTP_ORIGIN'], 'huahb.com') !== true && strpos($_SERVER['HTTP_ORIGIN'], 'huaml.com') !== true && strpos($_SERVER['HTTP_ORIGIN'], 'hhb.com') !== true) {
 			$connection->close();
 		}
-
 		// onWebSocketConnect 里面$_GET $_SERVER是可用的
 		// var_dump($_GET, $_SERVER);
 	};