@decentnetwork/lan 0.1.181 → 0.1.182

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
Binary file
Binary file
@@ -240,6 +240,20 @@ export function startMultiExitRouter(opts) {
240
240
  // route kept failing get auto-promoted into the fallback region (and
241
241
  // persisted). Explicit domain lists always win over learned entries.
242
242
  const learner = new RouteLearner(opts.learnedRoutesPath, log);
243
+ // Auto-purge on startup: drop any EXISTING learned entry for a global host
244
+ // (google/gstatic/…) that older builds mislearned into an exit. So a user just
245
+ // updating + restarting is self-healed — no manual learned-routes cleanup.
246
+ {
247
+ let purged = 0;
248
+ for (const { host } of learner.entries()) {
249
+ if (NEVER_LEARN.test(host)) {
250
+ learner.unlearn(host);
251
+ purged++;
252
+ }
253
+ }
254
+ if (purged > 0)
255
+ log(`purged ${purged} stale global-host route(s) mislearned into an exit`);
256
+ }
243
257
  const fallbackRegion = opts.fallbackRegion
244
258
  ?? regions.find((r) => opts.exits.some((e) => (e.region ?? "default") === r.name))?.name
245
259
  ?? null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/lan",
3
- "version": "0.1.181",
3
+ "version": "0.1.182",
4
4
  "description": "Private virtual LAN for self-hosted services and AI agents, built on Elastos Carrier. NAT-traversal, name service, ACL, all over a peer-to-peer mesh — no public IP required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",