|
|
@ -33,11 +33,22 @@ if (isset($_GET['host']) && !\Yggverse\Net\Socket::isHost($_GET['host'])) |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set client address if optional host not provided |
|
|
|
|
|
|
|
if (empty($_GET['host']) && isset($_SERVER['REMOTE_ADDR']) && !\Yggverse\Net\Socket::isHost($_SERVER['REMOTE_ADDR'])) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$host = $_SERVER['REMOTE_ADDR']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$host = $_GET['host']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Connection test |
|
|
|
// Connection test |
|
|
|
exit( |
|
|
|
exit( |
|
|
|
json_encode( |
|
|
|
json_encode( |
|
|
|
[ |
|
|
|
[ |
|
|
|
'success' => \Yggverse\Net\Socket::isOpen($_GET['host'], $_GET['port']) |
|
|
|
'success' => \Yggverse\Net\Socket::isOpen($_GET['host'], $_GET['port'], 3) |
|
|
|
] |
|
|
|
] |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|