theseus/dev/test-directip.mjs
Local Dev 7898e78ff4 Initial commit — Silent Mode baseline (2026-07-29)
Snapshot of the decentralized-web stack at the point of the resolver+Theseus
rebuild deploy. Includes:

- Argus (BNS engine + resolver daemon + Sia gateway)
- AriadneResolver (Windows Inno installer bundle + Android APK sources +
  Firefox extension)
- TheseusNavigator (Electron browser)
- site/ (silentmode.st content, deployed to Sia at bns/silentmode/)
- design docs, roadmap, protocol spec

Secrets excluded via .gitignore: Argus/sia-s3.json, Argus/wallets.json,
Argus/ca/*.key,*.crt. Build outputs, node_modules, and bundled runtimes
also excluded.

Shipped hashes on dl.silentmode.st at this commit:
  AriadneResolver-Setup-0.1.0.exe    5bcb216eef31ea28ed767e4134ab74bd5ac69dfbd365fd249e9e6938e55c986a
  TheseusNavigator-Setup-0.0.1.exe   7c735e88bad2da3347145adba3016c8f626a18b8422289c8c6ba471972e2952b
  TheseusNavigator-0.0.1-portable.exe 008fd84445babeabb401b2bca40ea9466b24b0e6d6c85104da7640c5c5c84521
  ariadne-v0.2.apk                   635c8f04d44ef855a8390b9eeddb8cd2d50622e81cc4e5004e8daffc1bb0425c
2026-07-29 13:54:34 +02:00

32 lines
1.2 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Prove the DNS-independent path: a WS wrapper that FAILS for any hostname URL,
// so a successful .bch resolution can only have come from the pinned IP + SNI.
import WebSocket from "ws";
import { resolveName } from "../../Argus/src/lib/resolver-web.js";
const isIpUrl = (u) => /\/\/\d{1,3}(\.\d{1,3}){3}:/.test(u);
class DnsDeadWS extends WebSocket {
constructor(url, opts) {
if (isIpUrl(url)) {
console.log(" → connecting by IP:", url, "SNI:", opts?.servername);
super(url, opts);
} else {
console.log(" ✗ hostname blocked (simulated dead DNS):", url);
super("wss://127.0.0.1:1"); // unreachable → error → triggers IP fallback
}
}
}
console.log("resolving hello.bch with system DNS 'dead' (hostnames blocked)…");
try {
const entry = await resolveName("hello.bch", { WebSocket: DnsDeadWS, directIP: true });
if (entry) {
console.log("\n✅ RESOLVED via pinned IP — DNS-independent path works.");
console.log(" records:", Object.keys(entry.records).join(", "));
} else {
console.log("\n⚠ connected but hello.bch not found (name may be unregistered) — IP path still worked.");
}
} catch (e) {
console.log("\n❌ FAILED:", e.message);
}
process.exit(0);