Virtual multi-network allocator: synthetic IPv4 (925.*) + IPv6 + DNS mapping for apps/bots/servers.
npm install teamx-netA 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.
``bash`
npm i teamx-net
`js
const { createNetworkManager } = require("teamx-net");
const mgr = createNetworkManager(); // IPv4 uses 925.
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"));
`
By default each network reserves:
- DNS IPv4: 925.DNS IPv6
- : host id 53 within the IPv6 /64
`js
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.10
`
- 925.x.x.x is synthetic and not valid on real networks. That’s the point: it’s private to your runtime.netIndex` 0..255).
- v2 supports up to 256 networks by default (