[ 'header' => "User-Agent: Mozilla/5.0" . PHP_EOL . 'Referer: https://www.pixiv.net/' ] ]; if (HTTP_PROXY) { $stream_context['http']['proxy'] = 'tcp://' . HTTP_PROXY; } $response = file_get_contents('https://' . $_GET['dest'], false, stream_context_create($stream_context)); if (!$response) { http_response_code(500); die('Proxy failed'); } foreach ($http_response_header as $header) { if (strpos($header, 'Content-Type: ') === 0) { header($header); break; } } $path = explode('/', $_GET['dest']); header('Content-Disposition: filename="' . $path[count($path) - 1] . '"'); echo $response;