<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Secure Website</title>
    <style>
        body {
            font-family: Arial, sans-serif;
        }
        .blocked {
            background-color: white;
            color: black;
            text-align: center;
            margin-top: 20%;
        }
    </style>
    <script>
        // HTTP Canary Detection (User-Agent Check)
        function detectHttpCanary() {
            const userAgent = navigator.userAgent.toLowerCase();
            if (userAgent.includes("httpcanary") || userAgent.includes("fiddler") || userAgent.includes("mitmproxy")) {
                // If HTTP Canary is detected, make screen white
                document.body.innerHTML = '<div class="blocked"><h1>Access Blocked</h1><p>HTTP Canary or similar proxy tool detected!</p></div>';
                document.body.style.backgroundColor = "white";
            }
        }

        // VPN/Proxy Detection (IP-Based)
        async function detectVPN() {
            try {
                const response = await fetch("https://api.ipregistry.co/?key=tryout"); // Replace with your VPN detection API key
                const data = await response.json();

                if (data.location.is_vpn || data.security.is_proxy) {
                    // If VPN or Proxy detected, block access
                    document.body.innerHTML = '<div class="blocked"><h1>Access Blocked</h1><p>VPN or Proxy use is not allowed on this website.</p></div>';
                    document.body.style.backgroundColor = "white";
                }
            } catch (error) {
                console.error("VPN/Proxy detection failed:", error);
            }
        }

        // Disable Developer Tools
        function disableDevTools() {
            document.addEventListener("keydown", function(e) {
                if (e.key === "F12" || (e.ctrlKey && e.shiftKey && e.key === "I")) {
                    e.preventDefault();
                    alert("Developer tools are disabled.");
                }
            });
        }

        // Call Detection Functions on Page Load
        window.onload = function () {
            detectHttpCanary();
            detectVPN();
            disableDevTools();
        };
    </script>
</head>
</html>
