@decentnetwork/lan 0.1.164 → 0.1.165
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
|
package/dist/daemon/server.js
CHANGED
|
@@ -466,10 +466,14 @@ export class DaemonServer {
|
|
|
466
466
|
// receive is the inline FileModel-JSON-over-bulkmsg envelope the
|
|
467
467
|
// Beagle apps themselves use. Detected via the DHT-key signature.
|
|
468
468
|
if (this.peerManager?.isNativeFriend(userid)) {
|
|
469
|
-
|
|
469
|
+
// The FileModel JSON envelope is base64 (inflates ~1.34x) + a little
|
|
470
|
+
// JSON overhead, and the whole thing must fit the 5MB bulkmsg cap
|
|
471
|
+
// (CARRIER_MAX_APP_BULKMSG_LEN). 3.5MB raw → ~4.7MB envelope, safely
|
|
472
|
+
// under 5MB. (Was a conservative 2MB.)
|
|
473
|
+
const INLINE_MAX = 3.5 * 1024 * 1024;
|
|
470
474
|
if (data.length > INLINE_MAX) {
|
|
471
475
|
throw new Error(`This friend is a native (iOS/Android) client — files are sent inline and limited to ` +
|
|
472
|
-
`${(INLINE_MAX / 1024 / 1024)
|
|
476
|
+
`${(INLINE_MAX / 1024 / 1024).toFixed(1)} MB (this is ${(data.length / 1024 / 1024).toFixed(1)} MB).`);
|
|
473
477
|
}
|
|
474
478
|
await this.peerManager.sendInlineFile(userid, new Uint8Array(data), name);
|
|
475
479
|
this.logger.info(`Sent inline file "${name}" (${data.length}B) to native peer ${userid.slice(0, 8)}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/lan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.165",
|
|
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",
|