@decentnetwork/lan 0.1.147 → 0.1.149

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
@@ -1400,8 +1400,19 @@ export async function cmdProxyRouter(args) {
1400
1400
  exits.push(ex);
1401
1401
  }
1402
1402
  }
1403
- defaultRegion = routesFile.default ?? "direct";
1403
+ // --all forces a FULL tunnel even with a routes.yaml: unmatched hosts go
1404
+ // through an exit region instead of DIRECT, so nothing can leak to the
1405
+ // local (out-of-region) IP. Previously --all was silently ignored on this
1406
+ // file-driven path. Prefer the file's declared default, else the first
1407
+ // region (e.g. china).
1408
+ // --all OVERRIDES the file's default (e.g. `default: direct`) — route every
1409
+ // unmatched host through the first exit region instead of leaking direct.
1410
+ defaultRegion = args.all
1411
+ ? (regions[0]?.name ?? "direct")
1412
+ : (routesFile.default ?? "direct");
1404
1413
  console.log(`Loaded ${regions.length} region(s) from ${routesPath}`);
1414
+ if (args.all)
1415
+ console.log(`--all: unmatched hosts → region [${defaultRegion}] (full tunnel, no DIRECT leak)`);
1405
1416
  }
1406
1417
  else if (args.all) {
1407
1418
  // ---- --all: every discovered peer through exits, single region --------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/lan",
3
- "version": "0.1.147",
3
+ "version": "0.1.149",
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",