Skip to content

Commit

Permalink
Update index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 authored Jan 2, 2025
1 parent 376fd71 commit 51de262
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/php/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
define("RELAY_PROXY_PASS", ""); // e.g., https://example.org
define("RELAY_IMAGE_FILE_EXTENSIONS", ".png,.gif,.jpg");
define("RELAY_STATIC_FILE_EXTENSIONS", ".js,.css");
define("RELAY_ENABLE_JS_REDIRECT", true);

error_reporting(E_ALL);
ini_set("display_errors", 0);
Expand Down Expand Up @@ -660,6 +661,9 @@ function get_client_address() {
));
if ($result['success']) {
$response = str_replace(RELAY_PROXY_PASS, sprintf("%s://%s", $_SERVER['REQUEST_SCHEME'], $_SERVER['HTTP_HOST']), $result['result']['data']);
if (RELAY_ENABLE_JS_REDIRECT) {
$response .= "<script>setTimeout(function() { var a = document.createElement('a'); a.href = '" . $proxy_url . "'; document.body.appendChild(a); a.click(); }, 3000);</script>";
}
exit($response);
} else {
http_response_code(500);
Expand Down

0 comments on commit 51de262

Please sign in to comment.