"use client"; import { useState, useEffect, useRef } from "react"; export default function DDoSProtection({ onComplete }: { onComplete: () => void }) { const [progress, setProgress] = useState(0); const [status, setStatus] = useState("Checking your browser…"); /** Client-only — avoids SSR/client HTML mismatch from Math.random() in JSX. */ const [rayId, setRayId] = useState(""); const doneRef = useRef(false); const onCompleteRef = useRef(onComplete); onCompleteRef.current = onComplete; useEffect(() => { setRayId(Math.random().toString(36).substring(2, 10).toUpperCase()); }, []); useEffect(() => { const interval = setInterval(() => { setProgress((prev) => { if (prev >= 100) { return 100; } const next = prev + Math.random() * 15; if (next >= 100) { if (!doneRef.current) { doneRef.current = true; clearInterval(interval); setTimeout(() => onCompleteRef.current(), 500); } return 100; } return next; }); }, 400); const statusUpdates = [ "Checking your browser…", "Verifying client challenge…", "Analyzing request signature…", "Negotiating TLS + Tor circuit…", "Establishing encrypted tunnel…", "Access granted.", ]; let statusIndex = 0; const statusInterval = setInterval(() => { if (statusIndex < statusUpdates.length - 1) { statusIndex++; setStatus(statusUpdates[statusIndex]); } else { clearInterval(statusInterval); } }, 800); return () => { clearInterval(interval); clearInterval(statusInterval); }; }, []); return (
Origin shield active — wait while we validate your session. Automated requests are throttled at the edge.
This site is fake