GeminiBot commited on
Commit ·
afd22b0
1
Parent(s): e97c1d1
Add IP check to diagnostics
Browse files122 unmodified lines123124125126127128129130131132133134135136137138139140141142126127128129130131132133134135136137138139140141142143144145146147148149150122 unmodified lines uptime: process.uptime() }; // 2. Check Network & DuckDuckGo Connectivity try { const start = Date.now(); const res = await fetch("https://duckduckgo.com/duckchat/v1/status?q=1", { headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" } }); const hash = res.headers.get("x-vqd-hash-1"); report.checks.duckduckgo = { status: res.status, latency_ms: Date.now() - start, vqd_present: !!hash, ip_blocked: res.status === 403 || res.status === 418 }; } catch (e: any) { report.checks.duckduckgo = { error: e.message }; } // 2. Check Network & DuckDuckGo Connectivity try { const start = Date.now(); // Check IP const ipRes = await fetch("https://api.ipify.org?format=json"); const ipData = await ipRes.json() as any; const res = await fetch("https://duckduckgo.com/duckchat/v1/status?q=1", { headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" } }); const hash = res.headers.get("x-vqd-hash-1"); report.checks.duckduckgo = { status: res.status, latency_ms: Date.now() - start, vqd_present: !!hash, ip_blocked: res.status === 403 || res.status === 418, server_ip: ipData.ip }; } catch (e: any) { report.checks.duckduckgo = { error: e.message }; } // 3. Check JSDOM & Canvas Mock try { const { JSDOM } = require("jsdom");src/server.ts+22-17