@decentnetwork/lan 0.1.78 → 0.1.79

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
@@ -445,10 +445,10 @@ export class PeerManager extends EventEmitter {
445
445
  }
446
446
  this.emit("message", message.pubkey, message.text);
447
447
  });
448
- // decentlan custom packets: IP data (192, lossy), session handshake
449
- // (161, lossless), dora control (162, lossless). Each on its own Carrier
450
- // packet id — a chat message can never be mistaken for an IP packet, and
451
- // no crafted message can inject onto the TUN.
448
+ // decentlan custom packets, all lossless so they traverse relay-only
449
+ // sessions: IP data (163), session handshake (161), dora control (162).
450
+ // Each on its own Carrier packet id — a chat message can never be mistaken
451
+ // for an IP packet, and no crafted message can inject onto the TUN.
452
452
  this.peer.onCustomPacket(({ pubkey, id, data }) => {
453
453
  try {
454
454
  if (id === PACKET_ID_DL_DORA) {
@@ -10,4 +10,4 @@ export declare const FRAME_MAGIC = 170;
10
10
  export declare const FRAME_HEADER_SIZE = 6;
11
11
  export declare const PACKET_ID_DL_SESSION = 161;
12
12
  export declare const PACKET_ID_DL_DORA = 162;
13
- export declare const PACKET_ID_DL_IP = 192;
13
+ export declare const PACKET_ID_DL_IP = 163;
@@ -15,4 +15,13 @@ export const FRAME_HEADER_SIZE = 6; // magic(1) + length(2) + sessionId(2) + opc
15
15
  // so IP traffic can never be confused with a Carrier message.
16
16
  export const PACKET_ID_DL_SESSION = 161; // lossless: session handshake frames (must arrive)
17
17
  export const PACKET_ID_DL_DORA = 162; // lossless: dora control (must arrive)
18
- export const PACKET_ID_DL_IP = 192; // lossy: IP data frames (best-effort; inner TCP retransmits)
18
+ // IP data MUST be lossless (160-191), NOT lossy (192-254). toxcore only carries
19
+ // lossy packets over a live UDP path; on a relay-only session (no direct
20
+ // hole-punch — e.g. any China↔abroad link through the GFW) lossy packets are
21
+ // silently dropped, so IP traffic died while chat/dora (lossless) kept working.
22
+ // Proven in the field: a node behind the GFW registered with the dora over 162
23
+ // (lossless) on the same relay session that dropped every 192 (lossy) IP packet.
24
+ // Lossless rides the reliable buffer and is delivered over UDP *or* TCP relay.
25
+ // The TCP-over-TCP cost on a direct path is the accepted trade — relay delivery
26
+ // is non-negotiable. (The handshake at 161 already exempts IP from chat-64.)
27
+ export const PACKET_ID_DL_IP = 163; // lossless: IP data frames (must traverse relays)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/lan",
3
- "version": "0.1.78",
3
+ "version": "0.1.79",
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",