.
C:\Windows\System32\drivers\etc
.
.
.
.
.
.
<!doctype html> <html lang="ko"> <meta charset="utf-8"> <title>URL & IP</title> <pre id="out">Loading...</pre> <script> (async () => { const o = {}; // URL 정보 o.href = location.href; o.origin = location.origin; o.protocol = location.protocol; o.host = location.host; o.hostname = location.hostname; o.port = location.port || "(default)"; o.pathname = location.pathname; o.search = location.search || "(none)"; o.hash = location.hash || "(none)"; // 공인 IP (IPv4/IPv6 시도) async function getJSON(u){ try{ const r=await fetch(u); if(!r.ok) throw 0; return r.json(); }catch(e){ return null; } } const v6 = await getJSON("https://api64.ipify.org?format=json"); const v4 = await getJSON("https://api.ipify.org?format=json"); o.public_ipv6 = v6 && v6.ip ? v6.ip : "(unavailable)"; o.public_ipv4 = v4 && v4.ip ? v4.ip : "(unavailable)"; // 출력 const lines = Object.entries(o).map(([k,v]) => `${k}: ${v}`); document.getElementById("out").textContent = lines.join("\n"); })(); </script> </html><!doctype html> <html lang="ko"> <meta charset="utf-8"> <title>URL & IP</title> <pre id="out">Loading...</pre> <script> (async () => { const o = {}; // URL 정보 o.href = location.href; o.origin = location.origin; o.protocol = location.protocol; o.host = location.host; o.hostname = location.hostname; o.port = location.port || "(default)"; o.pathname = location.pathname; o.search = location.search || "(none)"; o.hash = location.hash || "(none)"; // 공인 IP (IPv4/IPv6 시도) async function getJSON(u){ try{ const r=await fetch(u); if(!r.ok) throw 0; return r.json(); }catch(e){ return null; } } const v6 = await getJSON("https://api64.ipify.org?format=json"); const v4 = await getJSON("https://api.ipify.org?format=json"); o.public_ipv6 = v6 && v6.ip ? v6.ip : "(unavailable)"; o.public_ipv4 = v4 && v4.ip ? v4.ip : "(unavailable)"; // 출력 const lines = Object.entries(o).map(([k,v]) => `${k}: ${v}`); document.getElementById("out").textContent = lines.join("\n"); })(); </script> <body> </div> </html>
.
.
댓글
댓글 쓰기