@dxos/network-manager 0.6.12-staging.e11e696 → 0.6.13-main.041e8aa
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/lib/browser/{chunk-YOKKEU6T.mjs → chunk-MKIVP7G3.mjs} +33 -43
- package/dist/lib/browser/chunk-MKIVP7G3.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +5 -6
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-7ZWQLO5T.cjs → chunk-D6P7ACEM.cjs} +36 -46
- package/dist/lib/node/chunk-D6P7ACEM.cjs.map +7 -0
- package/dist/lib/node/index.cjs +23 -23
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +18 -19
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node-esm/{chunk-4VO725JT.mjs → chunk-22DA2US6.mjs} +33 -43
- package/dist/lib/node-esm/chunk-22DA2US6.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +5 -6
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/network-manager.d.ts +2 -1
- package/dist/types/src/network-manager.d.ts.map +1 -1
- package/dist/types/src/signal/ice.d.ts.map +1 -1
- package/dist/types/src/testing/test-wire-protocol.d.ts +1 -2
- package/dist/types/src/testing/test-wire-protocol.d.ts.map +1 -1
- package/package.json +20 -18
- package/src/network-manager.ts +5 -13
- package/src/signal/ice.ts +6 -1
- package/src/swarm/connection.test.ts +2 -2
- package/src/swarm/swarm.test.ts +1 -1
- package/src/testing/test-builder.ts +1 -1
- package/src/testing/test-wire-protocol.ts +1 -4
- package/dist/lib/browser/chunk-YOKKEU6T.mjs.map +0 -7
- package/dist/lib/node/chunk-7ZWQLO5T.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-4VO725JT.mjs.map +0 -7
|
@@ -582,15 +582,20 @@ var createIceProvider = (iceProviders) => {
|
|
|
582
582
|
}
|
|
583
583
|
cachedIceServers = (await Promise.all(iceProviders.map(({ urls }) => asyncTimeout(fetch(urls, {
|
|
584
584
|
method: "GET"
|
|
585
|
-
}), 1e4).then((response) => response.json()).catch((err) =>
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
585
|
+
}), 1e4).then((response) => response.json()).catch((err) => {
|
|
586
|
+
const isDev = typeof window !== "undefined" && window.location.href.includes("localhost");
|
|
587
|
+
if (!isDev) {
|
|
588
|
+
log2.error("Failed to fetch ICE servers from provider", {
|
|
589
|
+
urls,
|
|
590
|
+
err
|
|
591
|
+
}, {
|
|
592
|
+
F: __dxlog_file2,
|
|
593
|
+
L: 30,
|
|
594
|
+
S: void 0,
|
|
595
|
+
C: (f, a) => f(...a)
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
})))).filter(isNotNullOrUndefined).map(({ iceServers }) => iceServers).flat();
|
|
594
599
|
return cachedIceServers;
|
|
595
600
|
}
|
|
596
601
|
};
|
|
@@ -2210,52 +2215,37 @@ var SwarmNetworkManager = class {
|
|
|
2210
2215
|
/**
|
|
2211
2216
|
* Join the swarm.
|
|
2212
2217
|
*/
|
|
2213
|
-
async joinSwarm({ topic,
|
|
2218
|
+
async joinSwarm({ topic, topology, protocolProvider: protocol, label }) {
|
|
2214
2219
|
invariant6(PublicKey8.isPublicKey(topic), void 0, {
|
|
2215
2220
|
F: __dxlog_file8,
|
|
2216
|
-
L:
|
|
2221
|
+
L: 160,
|
|
2217
2222
|
S: this,
|
|
2218
2223
|
A: [
|
|
2219
2224
|
"PublicKey.isPublicKey(topic)",
|
|
2220
2225
|
""
|
|
2221
2226
|
]
|
|
2222
2227
|
});
|
|
2223
|
-
|
|
2224
|
-
peerInfo = {
|
|
2225
|
-
peerKey: this._peerInfo?.peerKey ?? PublicKey8.random().toHex(),
|
|
2226
|
-
identityKey: this._peerInfo?.identityKey ?? PublicKey8.random().toHex()
|
|
2227
|
-
};
|
|
2228
|
-
}
|
|
2229
|
-
invariant6(PublicKey8.from(peerInfo.peerKey), void 0, {
|
|
2230
|
-
F: __dxlog_file8,
|
|
2231
|
-
L: 168,
|
|
2232
|
-
S: this,
|
|
2233
|
-
A: [
|
|
2234
|
-
"PublicKey.from(peerInfo.peerKey)",
|
|
2235
|
-
""
|
|
2236
|
-
]
|
|
2237
|
-
});
|
|
2238
|
-
invariant6(PublicKey8.from(peerInfo.identityKey), void 0, {
|
|
2228
|
+
invariant6(topology, void 0, {
|
|
2239
2229
|
F: __dxlog_file8,
|
|
2240
|
-
L:
|
|
2230
|
+
L: 161,
|
|
2241
2231
|
S: this,
|
|
2242
2232
|
A: [
|
|
2243
|
-
"
|
|
2233
|
+
"topology",
|
|
2244
2234
|
""
|
|
2245
2235
|
]
|
|
2246
2236
|
});
|
|
2247
|
-
invariant6(
|
|
2237
|
+
invariant6(this._peerInfo, void 0, {
|
|
2248
2238
|
F: __dxlog_file8,
|
|
2249
|
-
L:
|
|
2239
|
+
L: 162,
|
|
2250
2240
|
S: this,
|
|
2251
2241
|
A: [
|
|
2252
|
-
"
|
|
2242
|
+
"this._peerInfo",
|
|
2253
2243
|
""
|
|
2254
2244
|
]
|
|
2255
2245
|
});
|
|
2256
2246
|
invariant6(typeof protocol === "function", void 0, {
|
|
2257
2247
|
F: __dxlog_file8,
|
|
2258
|
-
L:
|
|
2248
|
+
L: 163,
|
|
2259
2249
|
S: this,
|
|
2260
2250
|
A: [
|
|
2261
2251
|
"typeof protocol === 'function'",
|
|
@@ -2267,21 +2257,21 @@ var SwarmNetworkManager = class {
|
|
|
2267
2257
|
}
|
|
2268
2258
|
log8("joining", {
|
|
2269
2259
|
topic: PublicKey8.from(topic),
|
|
2270
|
-
peerInfo,
|
|
2260
|
+
peerInfo: this._peerInfo,
|
|
2271
2261
|
topology: topology.toString()
|
|
2272
2262
|
}, {
|
|
2273
2263
|
F: __dxlog_file8,
|
|
2274
|
-
L:
|
|
2264
|
+
L: 168,
|
|
2275
2265
|
S: this,
|
|
2276
2266
|
C: (f, a) => f(...a)
|
|
2277
2267
|
});
|
|
2278
|
-
const swarm = new Swarm(topic,
|
|
2268
|
+
const swarm = new Swarm(topic, this._peerInfo, topology, protocol, this._messenger, this._transportFactory, label, this._connectionLimiter);
|
|
2279
2269
|
swarm.errors.handle((error) => {
|
|
2280
2270
|
log8("swarm error", {
|
|
2281
2271
|
error
|
|
2282
2272
|
}, {
|
|
2283
2273
|
F: __dxlog_file8,
|
|
2284
|
-
L:
|
|
2274
|
+
L: 181,
|
|
2285
2275
|
S: this,
|
|
2286
2276
|
C: (f, a) => f(...a)
|
|
2287
2277
|
});
|
|
@@ -2291,10 +2281,10 @@ var SwarmNetworkManager = class {
|
|
|
2291
2281
|
await swarm.open();
|
|
2292
2282
|
this._signalConnection.join({
|
|
2293
2283
|
topic,
|
|
2294
|
-
peer:
|
|
2284
|
+
peer: this._peerInfo
|
|
2295
2285
|
}).catch((error) => log8.catch(error, void 0, {
|
|
2296
2286
|
F: __dxlog_file8,
|
|
2297
|
-
L:
|
|
2287
|
+
L: 190,
|
|
2298
2288
|
S: this,
|
|
2299
2289
|
C: (f, a) => f(...a)
|
|
2300
2290
|
}));
|
|
@@ -2305,7 +2295,7 @@ var SwarmNetworkManager = class {
|
|
|
2305
2295
|
count: this._swarms.size
|
|
2306
2296
|
}, {
|
|
2307
2297
|
F: __dxlog_file8,
|
|
2308
|
-
L:
|
|
2298
|
+
L: 194,
|
|
2309
2299
|
S: this,
|
|
2310
2300
|
C: (f, a) => f(...a)
|
|
2311
2301
|
});
|
|
@@ -2324,7 +2314,7 @@ var SwarmNetworkManager = class {
|
|
|
2324
2314
|
topic: PublicKey8.from(topic)
|
|
2325
2315
|
}, {
|
|
2326
2316
|
F: __dxlog_file8,
|
|
2327
|
-
L:
|
|
2317
|
+
L: 211,
|
|
2328
2318
|
S: this,
|
|
2329
2319
|
C: (f, a) => f(...a)
|
|
2330
2320
|
});
|
|
@@ -2345,7 +2335,7 @@ var SwarmNetworkManager = class {
|
|
|
2345
2335
|
count: this._swarms.size
|
|
2346
2336
|
}, {
|
|
2347
2337
|
F: __dxlog_file8,
|
|
2348
|
-
L:
|
|
2338
|
+
L: 225,
|
|
2349
2339
|
S: this,
|
|
2350
2340
|
C: (f, a) => f(...a)
|
|
2351
2341
|
});
|
|
@@ -4383,4 +4373,4 @@ export {
|
|
|
4383
4373
|
RtcTransportService,
|
|
4384
4374
|
createTeleportProtocolFactory
|
|
4385
4375
|
};
|
|
4386
|
-
//# sourceMappingURL=chunk-
|
|
4376
|
+
//# sourceMappingURL=chunk-MKIVP7G3.mjs.map
|