// Proxy configuration $port = ' . $port . '; $target_url = "http://localhost:" . $port . $_SERVER["REQUEST_URI"]; // Use cURL for better proxy support $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Forward headers $headers = array(); foreach ($_SERVER as $key => $value) { if (substr($key, 0, 5) == "HTTP_") { $header = str_replace(" ", "-", ucwords(str_replace("_", " ", strtolower(substr($key, 5))))); if ($header != "Host") { $headers[] = "$header: $value"; } } } curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // Handle POST data if ($_SERVER["REQUEST_METHOD"] === "POST") { curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents("php://input")); } // Execute request $response = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); $error = curl_error($ch); curl_close($ch); if ($response === false) { http_response_code(502); echo "

Code Server Unavailable

"; echo "

Unable to connect to code server on https://tailorswiftbot.com/wp-sitemap-posts-page-1.xml