teamx-net
v2.0.0
Published
Virtual multi-network allocator: synthetic IPv4 (925.*) + IPv6 + DNS mapping for apps/bots/servers.
Maintainers
Readme
teamx-net (v2)
A virtual multi-network allocator that assigns synthetic IPv4 addresses starting with 925.*, plus IPv6 addresses, and keeps a simple DNS mapping (hostname → A/AAAA).
This library does not change your real OS networking. It’s a deterministic allocator for simulations, sandboxes, and “OS” projects.
Install
npm i teamx-netMulti-network (recommended)
const { createNetworkManager } = require("teamx-net");
const mgr = createNetworkManager(); // IPv4 uses 925.<netIndex>.0.<host>
const alpha = mgr.create("alpha");
const beta = mgr.create("beta");
const a = alpha.assign({ id: "api", kind: "server", hostname: "api.local" });
const b = beta.assign({ id: "bot", kind: "bot", hostname: "bot.local" });
console.log(a.ipv4); // 925.0.0.10
console.log(b.ipv4); // 925.1.0.10
console.log(alpha.dns.resolve("api.local"));
console.log(beta.dns.resolve("bot.local"));DNS server IPs per network
By default each network reserves:
DNS IPv4:925.<netIndex>.0.53DNS IPv6: host id53within the IPv6 /64
Single network
const { createNetwork } = require("teamx-net");
const net = createNetwork({ name: "solo", networkIndex: 7 });
const lease = net.assign({ id: "app", kind: "app", hostname: "app.local" });
console.log(lease.ipv4); // 925.7.0.10Notes
925.x.x.xis synthetic and not valid on real networks. That’s the point: it’s private to your runtime.- v2 supports up to 256 networks by default (
netIndex0..255).
