Update index.php

This commit is contained in:
Namhyeon Go 2024-06-21 12:16:27 +09:00
parent c2c7e2efdd
commit bcaa4e76df

View File

@ -6,10 +6,10 @@
* Namhyeon Go (Catswords Research) <abuse@catswords.net>
* https://github.com/gnh1201/caterpillar
* Created at: 2022-10-06
* Updated at: 2024-06-20
* Updated at: 2024-06-21
*/
define("PHP_HTTPPROXY_VERSION", "0.1.5.18");
define("PHP_HTTPPROXY_VERSION", "0.1.5.19");
define("DEFAULT_SOCKET_TIMEOUT", 1);
define("STATEFUL_SOCKET_TIMEOUT", 30);
define("MAX_EXECUTION_TIME", 0);
@ -350,6 +350,7 @@ function relay_dns_get_record($params) {
function relay_get_geolocation() {
$url = "https://ipapi.co/json/";
try {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@ -381,6 +382,16 @@ function relay_get_geolocation() {
"data" => $data
)
);
} catch (Exception $e) {
return array(
"success" => false,
"error" => array(
"status" => 503,
"code" => -1,
"message" => $e->__toString()
)
);
}
}
function relay_invoke_method($params) {