Update index.php

This commit is contained in:
Namhyeon Go 2024-02-27 15:38:17 +09:00 committed by GitHub
parent 38cced6090
commit 3c2d4b1845
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -286,6 +286,11 @@ function relay_get_loaded_extensions() {
return array("loaded_extensions" => get_loaded_extensions());
}
function relay_dns_get_record($params) {
$hostname = $params['hostname'];
return dns_get_record($hostname);
}
function relay_get_geolocation() {
$url = "https://ipapi.co/json/";
@ -385,6 +390,10 @@ if ($context['jsonrpc'] == "2.0") {
echo jsonrpc2_result_encode(relay_get_loaded_extensions(), $context['id']);
break;
case "relay_dns_get_record":
echo jsonrpc2_result_encode(relay_dns_get_record($context['params']), $context['id']);
break;
case "relay_get_geolocation":
$result = jsonrpc2_result_encode(relay_get_geolocation(), $context['id']);
if ($result['success']) {