|
|
@@ -87,11 +87,10 @@ $gateway->onConnect = function ($connection) {
|
|
|
$connection->close();
|
|
|
return;
|
|
|
}
|
|
|
- print_r($_SERVER['HTTP_X_REAL_IP']);
|
|
|
$_SESSION['remotip'] = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $connection->getRemoteIp();
|
|
|
$_SESSION['remotport'] = $connection->getRemotePort();
|
|
|
$_SERVER['REMOTE_ADDR'] = $_SESSION['remotip'];
|
|
|
- print_r(['rip' => $_SESSION['remotip'], 'sip' => $_SERVER['HTTP_X_REAL_IP']]);
|
|
|
+ print_r(['rip' => $_SESSION['remotip'], 'sip' => $_SERVER]);
|
|
|
|
|
|
|
|
|
// 可以在这里判断连接来源是否合法,不合法就关掉连接
|