Update index.php

This commit is contained in:
Namhyeon Go 2024-02-27 14:20:14 +09:00 committed by GitHub
parent 9e7c9a4f3f
commit fd078bf31d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -246,10 +246,18 @@ function relay_mysql_query($params, $mysqli) {
); );
} }
function get_version() { function relay_get_version() {
return array("version" => PHP_HTTPPROXY_VERSION); return array("version" => PHP_HTTPPROXY_VERSION);
} }
function relay_get_phpversion() {
return array("phpversion" => phpversion());
}
function relay_get_loaded_extensions() {
return array("loaded_extensions" => get_loaded_extensions());
}
function get_client_address() { function get_client_address() {
$client_address = ''; $client_address = '';
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
@ -292,8 +300,16 @@ if ($context['jsonrpc'] == "2.0") {
} }
break; break;
case "get_version": case "relay_get_version":
echo jsonrpc2_result_encode(get_version(), $context['id']); echo jsonrpc2_result_encode(relay_get_version(), $context['id']);
break;
case "relay_get_phpversion":
echo jsonrpc2_result_encode(relay_get_phpversion(), $context['id']);
break;
case "relay_get_loaded_extensions":
echo jsonrpc2_result_encode(relay_get_loaded_extensions(), $context['id']);
break; break;
case "get_client_address": case "get_client_address":