true, CURLOPT_TIMEOUT => 30, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTPHEADER => ['X-Forwarded-For: ' . $_SERVER['REMOTE_ADDR']] ]); $body = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); $type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE); curl_close($ch); http_response_code($code); if ($type) header("Content-Type: $type"); echo $body;