@decentnetwork/peer 0.1.108 → 0.1.109
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.
- package/dist/peer.js +12 -8
- package/package.json +1 -1
package/dist/peer.js
CHANGED
|
@@ -2169,17 +2169,21 @@ export class Peer {
|
|
|
2169
2169
|
// syscall (that was the CCTV CPU regression) — safe at CCTV packet
|
|
2170
2170
|
// rates.
|
|
2171
2171
|
this.#adoptRemote(state, remote.address, remote.port);
|
|
2172
|
-
// A successfully decrypted packet arriving from a private address
|
|
2173
|
-
//
|
|
2174
|
-
//
|
|
2175
|
-
//
|
|
2176
|
-
//
|
|
2177
|
-
//
|
|
2178
|
-
//
|
|
2172
|
+
// A successfully decrypted packet arriving from a private address is
|
|
2173
|
+
// stronger proof than an endpoint hint: it demonstrates that this
|
|
2174
|
+
// exact host:port already reaches us. Do not require the address to be
|
|
2175
|
+
// in one of this process' physical subnets. WSL commonly has only a
|
|
2176
|
+
// 172.16/12 vNIC while the real LAN peer is 10.0.0.x via the Windows
|
|
2177
|
+
// host NAT; direct UDP is confirmed, but a strict same-subnet check
|
|
2178
|
+
// leaves file transfer on the conservative public/relay pacer.
|
|
2179
|
+
//
|
|
2180
|
+
// Unverified private candidates still require same-subnet matching at
|
|
2181
|
+
// candidate-learn time. This relaxed lock is only for decrypted UDP,
|
|
2182
|
+
// so it cannot promote a spoofed or merely advertised private host.
|
|
2179
2183
|
if (!state.lanRemoteHost &&
|
|
2180
2184
|
isPrivateAddress(remote.address) &&
|
|
2181
2185
|
!isCgnatAddress(remote.address) &&
|
|
2182
|
-
|
|
2186
|
+
!this.#isUnroutableSelfSource(remote.address, remote.port)) {
|
|
2183
2187
|
state.lanRemoteHost = remote.address;
|
|
2184
2188
|
this.#rememberEndpointCandidate(state, remote.address, remote.port);
|
|
2185
2189
|
this.#debugLog(`lan_lock_confirmed friend=${friendId} host=${remote.address}:${remote.port} (decrypted UDP source)`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/peer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.109",
|
|
4
4
|
"description": "Pure TypeScript port of Elastos Carrier (toxcore-derived) P2P messaging. DHT, onion routing, TCP relay, FlatBuffers app payloads, Express offline relay. Wire-compatible with iOS Beagle and the Carrier C SDK.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|