@dxos/network-manager 0.3.9-main.3a0f16f → 0.3.9-main.3ced312
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-4HITD6WI.mjs → chunk-HJ6JLRZM.mjs} +250 -72
- package/dist/lib/browser/chunk-HJ6JLRZM.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 +1 -1
- package/dist/lib/node/{chunk-XE5JOIGD.cjs → chunk-JDKM4UPJ.cjs} +21 -13
- package/dist/lib/node/chunk-JDKM4UPJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-6AD7QA4X.cjs → chunk-XZF4MAFB.cjs} +259 -71
- package/dist/lib/node/chunk-XZF4MAFB.cjs.map +7 -0
- package/dist/lib/node/{datachannel-53JZPGFA.cjs → datachannel-3VTTIMR5.cjs} +9 -9
- package/dist/lib/node/{datachannel-53JZPGFA.cjs.map → datachannel-3VTTIMR5.cjs.map} +2 -2
- package/dist/lib/node/index.cjs +32 -32
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +19 -19
- package/dist/types/src/connection-log.d.ts.map +1 -1
- package/dist/types/src/swarm/connection.d.ts +4 -1
- package/dist/types/src/swarm/connection.d.ts.map +1 -1
- package/dist/types/src/transport/datachannel/rtc-peer-connection.d.ts +7 -0
- package/dist/types/src/transport/datachannel/rtc-peer-connection.d.ts.map +1 -1
- package/dist/types/src/transport/libdatachannel-transport.d.ts +3 -1
- package/dist/types/src/transport/libdatachannel-transport.d.ts.map +1 -1
- package/dist/types/src/transport/memory-transport.d.ts +3 -1
- package/dist/types/src/transport/memory-transport.d.ts.map +1 -1
- package/dist/types/src/transport/simplepeer-transport-proxy.d.ts +3 -1
- package/dist/types/src/transport/simplepeer-transport-proxy.d.ts.map +1 -1
- package/dist/types/src/transport/simplepeer-transport-service.d.ts +3 -1
- package/dist/types/src/transport/simplepeer-transport-service.d.ts.map +1 -1
- package/dist/types/src/transport/simplepeer-transport.d.ts +7 -1
- package/dist/types/src/transport/simplepeer-transport.d.ts.map +1 -1
- package/dist/types/src/transport/tcp-transport.browser.d.ts +3 -1
- package/dist/types/src/transport/tcp-transport.browser.d.ts.map +1 -1
- package/dist/types/src/transport/tcp-transport.d.ts +3 -1
- package/dist/types/src/transport/tcp-transport.d.ts.map +1 -1
- package/dist/types/src/transport/transport.d.ts +17 -0
- package/dist/types/src/transport/transport.d.ts.map +1 -1
- package/dist/types/src/wire-protocol.d.ts +1 -1
- package/dist/types/src/wire-protocol.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/connection-log.ts +14 -1
- package/src/swarm/connection.ts +23 -4
- package/src/transport/datachannel/rtc-peer-connection.ts +20 -12
- package/src/transport/libdatachannel-transport.test.ts +0 -4
- package/src/transport/libdatachannel-transport.ts +37 -1
- package/src/transport/memory-transport.ts +14 -1
- package/src/transport/simplepeer-transport-proxy.ts +9 -1
- package/src/transport/simplepeer-transport-service.ts +14 -0
- package/src/transport/simplepeer-transport.ts +66 -2
- package/src/transport/tcp-transport.browser.ts +9 -1
- package/src/transport/tcp-transport.ts +19 -1
- package/src/transport/transport.ts +19 -0
- package/src/wire-protocol.ts +3 -3
- package/dist/lib/browser/chunk-4HITD6WI.mjs.map +0 -7
- package/dist/lib/node/chunk-6AD7QA4X.cjs.map +0 -7
- package/dist/lib/node/chunk-XE5JOIGD.cjs.map +0 -7
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-YERMWDRB.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/core/mesh/network-manager/src/swarm/connection.ts
|
|
7
|
-
import { DeferredTask, Event, sleep, scheduleTask, synchronized } from "@dxos/async";
|
|
7
|
+
import { DeferredTask, Event, sleep, scheduleTask, scheduleTaskInterval, synchronized } from "@dxos/async";
|
|
8
8
|
import { Context, cancelWithContext } from "@dxos/context";
|
|
9
9
|
import { ErrorStream } from "@dxos/debug";
|
|
10
10
|
import { invariant } from "@dxos/invariant";
|
|
11
11
|
import { PublicKey } from "@dxos/keys";
|
|
12
|
-
import { log } from "@dxos/log";
|
|
12
|
+
import { log, logInfo } from "@dxos/log";
|
|
13
13
|
import { CancelledError, ProtocolError, ConnectionResetError, ConnectivityError, TimeoutError, UnknownProtocolError, trace } from "@dxos/protocols";
|
|
14
14
|
function _ts_decorate(decorators, target, key, desc) {
|
|
15
15
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -24,6 +24,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
24
24
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/swarm/connection.ts";
|
|
25
25
|
var STARTING_SIGNALLING_DELAY = 10;
|
|
26
26
|
var TRANSPORT_CONNECTION_TIMEOUT = 1e4;
|
|
27
|
+
var TRANSPORT_STATS_INTERVAL = 5e3;
|
|
27
28
|
var MAX_SIGNALLING_DELAY = 300;
|
|
28
29
|
var ConnectionState;
|
|
29
30
|
(function(ConnectionState5) {
|
|
@@ -86,6 +87,7 @@ var Connection = class {
|
|
|
86
87
|
this.stateChanged = new Event();
|
|
87
88
|
this.errors = new ErrorStream();
|
|
88
89
|
this._instanceId = PublicKey.random().toHex();
|
|
90
|
+
this.transportStats = new Event();
|
|
89
91
|
this._signalSendTask = new DeferredTask(this._ctx, async () => {
|
|
90
92
|
await this._flushSignalBuffer();
|
|
91
93
|
});
|
|
@@ -98,11 +100,14 @@ var Connection = class {
|
|
|
98
100
|
initiator: this.initiator
|
|
99
101
|
}, {
|
|
100
102
|
F: __dxlog_file,
|
|
101
|
-
L:
|
|
103
|
+
L: 134,
|
|
102
104
|
S: this,
|
|
103
105
|
C: (f, a) => f(...a)
|
|
104
106
|
});
|
|
105
107
|
}
|
|
108
|
+
get sessionIdString() {
|
|
109
|
+
return this.sessionId.truncate();
|
|
110
|
+
}
|
|
106
111
|
get state() {
|
|
107
112
|
return this._state;
|
|
108
113
|
}
|
|
@@ -118,7 +123,7 @@ var Connection = class {
|
|
|
118
123
|
async openConnection() {
|
|
119
124
|
invariant(this._state === ConnectionState.INITIAL, "Invalid state.", {
|
|
120
125
|
F: __dxlog_file,
|
|
121
|
-
L:
|
|
126
|
+
L: 164,
|
|
122
127
|
S: this,
|
|
123
128
|
A: [
|
|
124
129
|
"this._state === ConnectionState.INITIAL",
|
|
@@ -129,7 +134,7 @@ var Connection = class {
|
|
|
129
134
|
id: this._instanceId
|
|
130
135
|
}), {
|
|
131
136
|
F: __dxlog_file,
|
|
132
|
-
L:
|
|
137
|
+
L: 165,
|
|
133
138
|
S: this,
|
|
134
139
|
C: (f, a) => f(...a)
|
|
135
140
|
});
|
|
@@ -141,18 +146,18 @@ var Connection = class {
|
|
|
141
146
|
initiator: this.initiator
|
|
142
147
|
}, {
|
|
143
148
|
F: __dxlog_file,
|
|
144
|
-
L:
|
|
149
|
+
L: 166,
|
|
145
150
|
S: this,
|
|
146
151
|
C: (f, a) => f(...a)
|
|
147
152
|
});
|
|
148
153
|
this._changeState(ConnectionState.CONNECTING);
|
|
149
|
-
this._protocol.open().catch((err) => {
|
|
154
|
+
this._protocol.open(this.sessionId).catch((err) => {
|
|
150
155
|
this.errors.raise(err);
|
|
151
156
|
});
|
|
152
157
|
this._protocol.stream.on("close", () => {
|
|
153
158
|
log("protocol stream closed", void 0, {
|
|
154
159
|
F: __dxlog_file,
|
|
155
|
-
L:
|
|
160
|
+
L: 183,
|
|
156
161
|
S: this,
|
|
157
162
|
C: (f, a) => f(...a)
|
|
158
163
|
});
|
|
@@ -161,7 +166,7 @@ var Connection = class {
|
|
|
161
166
|
scheduleTask(this.connectedTimeoutContext, async () => {
|
|
162
167
|
log.info(`timeout waiting ${TRANSPORT_CONNECTION_TIMEOUT / 1e3}s for transport to connect, aborting`, void 0, {
|
|
163
168
|
F: __dxlog_file,
|
|
164
|
-
L:
|
|
169
|
+
L: 190,
|
|
165
170
|
S: this,
|
|
166
171
|
C: (f, a) => f(...a)
|
|
167
172
|
});
|
|
@@ -169,7 +174,7 @@ var Connection = class {
|
|
|
169
174
|
}, TRANSPORT_CONNECTION_TIMEOUT);
|
|
170
175
|
invariant(!this._transport, void 0, {
|
|
171
176
|
F: __dxlog_file,
|
|
172
|
-
L:
|
|
177
|
+
L: 198,
|
|
173
178
|
S: this,
|
|
174
179
|
A: [
|
|
175
180
|
"!this._transport",
|
|
@@ -179,18 +184,20 @@ var Connection = class {
|
|
|
179
184
|
this._transport = this._transportFactory.createTransport({
|
|
180
185
|
initiator: this.initiator,
|
|
181
186
|
stream: this._protocol.stream,
|
|
182
|
-
sendSignal: async (signal) => this._sendSignal(signal)
|
|
187
|
+
sendSignal: async (signal) => this._sendSignal(signal),
|
|
188
|
+
sessionId: this.sessionId
|
|
183
189
|
});
|
|
184
190
|
this._transport.connected.once(async () => {
|
|
185
191
|
this._changeState(ConnectionState.CONNECTED);
|
|
186
192
|
await this.connectedTimeoutContext.dispose();
|
|
187
193
|
this._callbacks?.onConnected?.();
|
|
194
|
+
scheduleTaskInterval(this._ctx, async () => this._emitTransportStats(), TRANSPORT_STATS_INTERVAL);
|
|
188
195
|
});
|
|
189
196
|
this._transport.closed.once(() => {
|
|
190
197
|
this._transport = void 0;
|
|
191
198
|
log("abort triggered by transport close", void 0, {
|
|
192
199
|
F: __dxlog_file,
|
|
193
|
-
L:
|
|
200
|
+
L: 216,
|
|
194
201
|
S: this,
|
|
195
202
|
C: (f, a) => f(...a)
|
|
196
203
|
});
|
|
@@ -201,7 +208,7 @@ var Connection = class {
|
|
|
201
208
|
err
|
|
202
209
|
}, {
|
|
203
210
|
F: __dxlog_file,
|
|
204
|
-
L:
|
|
211
|
+
L: 221,
|
|
205
212
|
S: this,
|
|
206
213
|
C: (f, a) => f(...a)
|
|
207
214
|
});
|
|
@@ -211,7 +218,7 @@ var Connection = class {
|
|
|
211
218
|
if (err instanceof ConnectionResetError) {
|
|
212
219
|
log.info("aborting due to transport ConnectionResetError", void 0, {
|
|
213
220
|
F: __dxlog_file,
|
|
214
|
-
L:
|
|
221
|
+
L: 228,
|
|
215
222
|
S: this,
|
|
216
223
|
C: (f, a) => f(...a)
|
|
217
224
|
});
|
|
@@ -219,7 +226,7 @@ var Connection = class {
|
|
|
219
226
|
} else if (err instanceof ConnectivityError) {
|
|
220
227
|
log.info("aborting due to transport ConnectivityError", void 0, {
|
|
221
228
|
F: __dxlog_file,
|
|
222
|
-
L:
|
|
229
|
+
L: 231,
|
|
223
230
|
S: this,
|
|
224
231
|
C: (f, a) => f(...a)
|
|
225
232
|
});
|
|
@@ -229,7 +236,7 @@ var Connection = class {
|
|
|
229
236
|
err
|
|
230
237
|
}, {
|
|
231
238
|
F: __dxlog_file,
|
|
232
|
-
L:
|
|
239
|
+
L: 234,
|
|
233
240
|
S: this,
|
|
234
241
|
C: (f, a) => f(...a)
|
|
235
242
|
});
|
|
@@ -247,7 +254,7 @@ var Connection = class {
|
|
|
247
254
|
id: this._instanceId
|
|
248
255
|
}), {
|
|
249
256
|
F: __dxlog_file,
|
|
250
|
-
L:
|
|
257
|
+
L: 250,
|
|
251
258
|
S: this,
|
|
252
259
|
C: (f, a) => f(...a)
|
|
253
260
|
});
|
|
@@ -257,14 +264,14 @@ var Connection = class {
|
|
|
257
264
|
err
|
|
258
265
|
}, {
|
|
259
266
|
F: __dxlog_file,
|
|
260
|
-
L:
|
|
267
|
+
L: 257,
|
|
261
268
|
S: this,
|
|
262
269
|
C: (f, a) => f(...a)
|
|
263
270
|
});
|
|
264
271
|
if (this._state === ConnectionState.CLOSED || this._state === ConnectionState.ABORTED) {
|
|
265
272
|
log(`abort ignored: already ${this._state}`, this.closeReason, {
|
|
266
273
|
F: __dxlog_file,
|
|
267
|
-
L:
|
|
274
|
+
L: 259,
|
|
268
275
|
S: this,
|
|
269
276
|
C: (f, a) => f(...a)
|
|
270
277
|
});
|
|
@@ -279,7 +286,7 @@ var Connection = class {
|
|
|
279
286
|
try {
|
|
280
287
|
log("aborting protocol... ", void 0, {
|
|
281
288
|
F: __dxlog_file,
|
|
282
|
-
L:
|
|
289
|
+
L: 273,
|
|
283
290
|
S: this,
|
|
284
291
|
C: (f, a) => f(...a)
|
|
285
292
|
});
|
|
@@ -287,7 +294,7 @@ var Connection = class {
|
|
|
287
294
|
} catch (err2) {
|
|
288
295
|
log.catch(err2, void 0, {
|
|
289
296
|
F: __dxlog_file,
|
|
290
|
-
L:
|
|
297
|
+
L: 276,
|
|
291
298
|
S: this,
|
|
292
299
|
C: (f, a) => f(...a)
|
|
293
300
|
});
|
|
@@ -297,7 +304,7 @@ var Connection = class {
|
|
|
297
304
|
} catch (err2) {
|
|
298
305
|
log.catch(err2, void 0, {
|
|
299
306
|
F: __dxlog_file,
|
|
300
|
-
L:
|
|
307
|
+
L: 283,
|
|
301
308
|
S: this,
|
|
302
309
|
C: (f, a) => f(...a)
|
|
303
310
|
});
|
|
@@ -307,7 +314,7 @@ var Connection = class {
|
|
|
307
314
|
} catch (err2) {
|
|
308
315
|
log.catch(err2, void 0, {
|
|
309
316
|
F: __dxlog_file,
|
|
310
|
-
L:
|
|
317
|
+
L: 289,
|
|
311
318
|
S: this,
|
|
312
319
|
C: (f, a) => f(...a)
|
|
313
320
|
});
|
|
@@ -331,7 +338,7 @@ var Connection = class {
|
|
|
331
338
|
peerId: this.ownId
|
|
332
339
|
}, {
|
|
333
340
|
F: __dxlog_file,
|
|
334
|
-
L:
|
|
341
|
+
L: 314,
|
|
335
342
|
S: this,
|
|
336
343
|
C: (f, a) => f(...a)
|
|
337
344
|
});
|
|
@@ -341,7 +348,7 @@ var Connection = class {
|
|
|
341
348
|
} catch (err2) {
|
|
342
349
|
log.catch(err2, void 0, {
|
|
343
350
|
F: __dxlog_file,
|
|
344
|
-
L:
|
|
351
|
+
L: 321,
|
|
345
352
|
S: this,
|
|
346
353
|
C: (f, a) => f(...a)
|
|
347
354
|
});
|
|
@@ -351,7 +358,7 @@ var Connection = class {
|
|
|
351
358
|
} catch (err2) {
|
|
352
359
|
log.catch(err2, void 0, {
|
|
353
360
|
F: __dxlog_file,
|
|
354
|
-
L:
|
|
361
|
+
L: 328,
|
|
355
362
|
S: this,
|
|
356
363
|
C: (f, a) => f(...a)
|
|
357
364
|
});
|
|
@@ -359,7 +366,7 @@ var Connection = class {
|
|
|
359
366
|
} else {
|
|
360
367
|
log.info(`graceful close requested when we were in ${lastState} state? aborting`, void 0, {
|
|
361
368
|
F: __dxlog_file,
|
|
362
|
-
L:
|
|
369
|
+
L: 331,
|
|
363
370
|
S: this,
|
|
364
371
|
C: (f, a) => f(...a)
|
|
365
372
|
});
|
|
@@ -368,7 +375,7 @@ var Connection = class {
|
|
|
368
375
|
} catch (err2) {
|
|
369
376
|
log.catch(err2, void 0, {
|
|
370
377
|
F: __dxlog_file,
|
|
371
|
-
L:
|
|
378
|
+
L: 335,
|
|
372
379
|
S: this,
|
|
373
380
|
C: (f, a) => f(...a)
|
|
374
381
|
});
|
|
@@ -378,7 +385,7 @@ var Connection = class {
|
|
|
378
385
|
} catch (err2) {
|
|
379
386
|
log.catch(err2, void 0, {
|
|
380
387
|
F: __dxlog_file,
|
|
381
|
-
L:
|
|
388
|
+
L: 340,
|
|
382
389
|
S: this,
|
|
383
390
|
C: (f, a) => f(...a)
|
|
384
391
|
});
|
|
@@ -388,7 +395,7 @@ var Connection = class {
|
|
|
388
395
|
peerId: this.ownId
|
|
389
396
|
}, {
|
|
390
397
|
F: __dxlog_file,
|
|
391
|
-
L:
|
|
398
|
+
L: 344,
|
|
392
399
|
S: this,
|
|
393
400
|
C: (f, a) => f(...a)
|
|
394
401
|
});
|
|
@@ -431,7 +438,7 @@ var Connection = class {
|
|
|
431
438
|
err
|
|
432
439
|
}, {
|
|
433
440
|
F: __dxlog_file,
|
|
434
|
-
L:
|
|
441
|
+
L: 382,
|
|
435
442
|
S: this,
|
|
436
443
|
C: (f, a) => f(...a)
|
|
437
444
|
});
|
|
@@ -444,7 +451,7 @@ var Connection = class {
|
|
|
444
451
|
async signal(msg) {
|
|
445
452
|
invariant(msg.sessionId, void 0, {
|
|
446
453
|
F: __dxlog_file,
|
|
447
|
-
L:
|
|
454
|
+
L: 391,
|
|
448
455
|
S: this,
|
|
449
456
|
A: [
|
|
450
457
|
"msg.sessionId",
|
|
@@ -454,7 +461,7 @@ var Connection = class {
|
|
|
454
461
|
if (!msg.sessionId.equals(this.sessionId)) {
|
|
455
462
|
log("dropping signal for incorrect session id", void 0, {
|
|
456
463
|
F: __dxlog_file,
|
|
457
|
-
L:
|
|
464
|
+
L: 393,
|
|
458
465
|
S: this,
|
|
459
466
|
C: (f, a) => f(...a)
|
|
460
467
|
});
|
|
@@ -462,7 +469,7 @@ var Connection = class {
|
|
|
462
469
|
}
|
|
463
470
|
invariant(msg.data.signal || msg.data.signalBatch, void 0, {
|
|
464
471
|
F: __dxlog_file,
|
|
465
|
-
L:
|
|
472
|
+
L: 396,
|
|
466
473
|
S: this,
|
|
467
474
|
A: [
|
|
468
475
|
"msg.data.signal || msg.data.signalBatch",
|
|
@@ -471,7 +478,7 @@ var Connection = class {
|
|
|
471
478
|
});
|
|
472
479
|
invariant(msg.author?.equals(this.remoteId), void 0, {
|
|
473
480
|
F: __dxlog_file,
|
|
474
|
-
L:
|
|
481
|
+
L: 397,
|
|
475
482
|
S: this,
|
|
476
483
|
A: [
|
|
477
484
|
"msg.author?.equals(this.remoteId)",
|
|
@@ -480,7 +487,7 @@ var Connection = class {
|
|
|
480
487
|
});
|
|
481
488
|
invariant(msg.recipient?.equals(this.ownId), void 0, {
|
|
482
489
|
F: __dxlog_file,
|
|
483
|
-
L:
|
|
490
|
+
L: 398,
|
|
484
491
|
S: this,
|
|
485
492
|
A: [
|
|
486
493
|
"msg.recipient?.equals(this.ownId)",
|
|
@@ -504,7 +511,7 @@ var Connection = class {
|
|
|
504
511
|
msg: msg.data
|
|
505
512
|
}, {
|
|
506
513
|
F: __dxlog_file,
|
|
507
|
-
L:
|
|
514
|
+
L: 407,
|
|
508
515
|
S: this,
|
|
509
516
|
C: (f, a) => f(...a)
|
|
510
517
|
});
|
|
@@ -512,7 +519,7 @@ var Connection = class {
|
|
|
512
519
|
} else {
|
|
513
520
|
invariant(this._transport, "Connection not ready to accept signals.", {
|
|
514
521
|
F: __dxlog_file,
|
|
515
|
-
L:
|
|
522
|
+
L: 410,
|
|
516
523
|
S: this,
|
|
517
524
|
A: [
|
|
518
525
|
"this._transport",
|
|
@@ -525,7 +532,7 @@ var Connection = class {
|
|
|
525
532
|
msg: msg.data
|
|
526
533
|
}, {
|
|
527
534
|
F: __dxlog_file,
|
|
528
|
-
L:
|
|
535
|
+
L: 411,
|
|
529
536
|
S: this,
|
|
530
537
|
C: (f, a) => f(...a)
|
|
531
538
|
});
|
|
@@ -543,13 +550,13 @@ var Connection = class {
|
|
|
543
550
|
peerId: this.ownId
|
|
544
551
|
}, {
|
|
545
552
|
F: __dxlog_file,
|
|
546
|
-
L:
|
|
553
|
+
L: 422,
|
|
547
554
|
S: this,
|
|
548
555
|
C: (f, a) => f(...a)
|
|
549
556
|
});
|
|
550
557
|
invariant(state !== this._state, "Already in this state.", {
|
|
551
558
|
F: __dxlog_file,
|
|
552
|
-
L:
|
|
559
|
+
L: 423,
|
|
553
560
|
S: this,
|
|
554
561
|
A: [
|
|
555
562
|
"state !== this._state",
|
|
@@ -559,7 +566,16 @@ var Connection = class {
|
|
|
559
566
|
this._state = state;
|
|
560
567
|
this.stateChanged.emit(state);
|
|
561
568
|
}
|
|
569
|
+
async _emitTransportStats() {
|
|
570
|
+
const stats = await this.transport?.getStats();
|
|
571
|
+
if (stats) {
|
|
572
|
+
this.transportStats.emit(stats);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
562
575
|
};
|
|
576
|
+
_ts_decorate([
|
|
577
|
+
logInfo
|
|
578
|
+
], Connection.prototype, "sessionIdString", null);
|
|
563
579
|
_ts_decorate([
|
|
564
580
|
synchronized
|
|
565
581
|
], Connection.prototype, "abort", null);
|
|
@@ -816,7 +832,7 @@ import { Context as Context4 } from "@dxos/context";
|
|
|
816
832
|
import { ErrorStream as ErrorStream2 } from "@dxos/debug";
|
|
817
833
|
import { invariant as invariant4 } from "@dxos/invariant";
|
|
818
834
|
import { PublicKey as PublicKey4 } from "@dxos/keys";
|
|
819
|
-
import { log as log4, logInfo } from "@dxos/log";
|
|
835
|
+
import { log as log4, logInfo as logInfo2 } from "@dxos/log";
|
|
820
836
|
import { trace as trace2 } from "@dxos/protocols";
|
|
821
837
|
import { ComplexMap as ComplexMap2, isNotNullOrUndefined } from "@dxos/util";
|
|
822
838
|
|
|
@@ -1780,13 +1796,13 @@ var Swarm = class {
|
|
|
1780
1796
|
}
|
|
1781
1797
|
};
|
|
1782
1798
|
_ts_decorate3([
|
|
1783
|
-
|
|
1799
|
+
logInfo2
|
|
1784
1800
|
], Swarm.prototype, "_instanceId", void 0);
|
|
1785
1801
|
_ts_decorate3([
|
|
1786
|
-
|
|
1802
|
+
logInfo2
|
|
1787
1803
|
], Swarm.prototype, "ownPeerId", null);
|
|
1788
1804
|
_ts_decorate3([
|
|
1789
|
-
|
|
1805
|
+
logInfo2
|
|
1790
1806
|
], Swarm.prototype, "topic", null);
|
|
1791
1807
|
_ts_decorate3([
|
|
1792
1808
|
synchronized3
|
|
@@ -2003,7 +2019,7 @@ var ConnectionLog = class {
|
|
|
2003
2019
|
};
|
|
2004
2020
|
info.connections.push(connectionInfo);
|
|
2005
2021
|
this.update.emit();
|
|
2006
|
-
connection.stateChanged.on((state) => {
|
|
2022
|
+
connection.stateChanged.on(async (state) => {
|
|
2007
2023
|
connectionInfo.state = state;
|
|
2008
2024
|
connectionInfo.closeReason = connection.closeReason;
|
|
2009
2025
|
connectionInfo.lastUpdate = /* @__PURE__ */ new Date();
|
|
@@ -2011,6 +2027,10 @@ var ConnectionLog = class {
|
|
|
2011
2027
|
type: EventType.CONNECTION_STATE_CHANGED,
|
|
2012
2028
|
newState: state
|
|
2013
2029
|
});
|
|
2030
|
+
if (state === ConnectionState.CONNECTED) {
|
|
2031
|
+
const details = await connection.transport?.getDetails();
|
|
2032
|
+
connectionInfo.transportDetails = details;
|
|
2033
|
+
}
|
|
2014
2034
|
this.update.emit();
|
|
2015
2035
|
});
|
|
2016
2036
|
connection.protocol?.stats?.on((stats) => {
|
|
@@ -2020,6 +2040,12 @@ var ConnectionLog = class {
|
|
|
2020
2040
|
connectionInfo.lastUpdate = /* @__PURE__ */ new Date();
|
|
2021
2041
|
this.update.emit();
|
|
2022
2042
|
});
|
|
2043
|
+
connection.transportStats?.on((stats) => {
|
|
2044
|
+
connectionInfo.transportBytesSent = stats.bytesSent;
|
|
2045
|
+
connectionInfo.transportBytesReceived = stats.bytesReceived;
|
|
2046
|
+
connectionInfo.transportPacketsSent = stats.packetsSent;
|
|
2047
|
+
connectionInfo.transportPacketsReceived = stats.packetsReceived;
|
|
2048
|
+
});
|
|
2023
2049
|
gcSwarm(info);
|
|
2024
2050
|
});
|
|
2025
2051
|
}
|
|
@@ -2530,7 +2556,7 @@ import { Event as Event7, Trigger } from "@dxos/async";
|
|
|
2530
2556
|
import { ErrorStream as ErrorStream3 } from "@dxos/debug";
|
|
2531
2557
|
import { invariant as invariant10 } from "@dxos/invariant";
|
|
2532
2558
|
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
2533
|
-
import { log as log10, logInfo as
|
|
2559
|
+
import { log as log10, logInfo as logInfo3 } from "@dxos/log";
|
|
2534
2560
|
import { ComplexMap as ComplexMap7 } from "@dxos/util";
|
|
2535
2561
|
function _ts_decorate4(decorators, target, key, desc) {
|
|
2536
2562
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2705,12 +2731,23 @@ var MemoryTransport = class _MemoryTransport {
|
|
|
2705
2731
|
this._remote.wake(remoteId);
|
|
2706
2732
|
}
|
|
2707
2733
|
}
|
|
2734
|
+
async getDetails() {
|
|
2735
|
+
return this._instanceId.toHex();
|
|
2736
|
+
}
|
|
2737
|
+
async getStats() {
|
|
2738
|
+
return {
|
|
2739
|
+
bytesSent: 0,
|
|
2740
|
+
bytesReceived: 0,
|
|
2741
|
+
packetsSent: 0,
|
|
2742
|
+
packetsReceived: 0
|
|
2743
|
+
};
|
|
2744
|
+
}
|
|
2708
2745
|
};
|
|
2709
2746
|
_ts_decorate4([
|
|
2710
|
-
|
|
2747
|
+
logInfo3
|
|
2711
2748
|
], MemoryTransport.prototype, "_instanceId", void 0);
|
|
2712
2749
|
_ts_decorate4([
|
|
2713
|
-
|
|
2750
|
+
logInfo3
|
|
2714
2751
|
], MemoryTransport.prototype, "_remoteInstanceId", void 0);
|
|
2715
2752
|
|
|
2716
2753
|
// packages/core/mesh/network-manager/src/transport/transport.ts
|
|
@@ -2742,6 +2779,9 @@ try {
|
|
|
2742
2779
|
// packages/core/mesh/network-manager/src/transport/simplepeer-transport.ts
|
|
2743
2780
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport.ts";
|
|
2744
2781
|
var SimplePeerTransport = class {
|
|
2782
|
+
/**
|
|
2783
|
+
* @params opts.config formatted as per https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection
|
|
2784
|
+
*/
|
|
2745
2785
|
constructor(params) {
|
|
2746
2786
|
this.params = params;
|
|
2747
2787
|
this._closed = false;
|
|
@@ -2754,13 +2794,13 @@ var SimplePeerTransport = class {
|
|
|
2754
2794
|
id: this._instanceId
|
|
2755
2795
|
}), {
|
|
2756
2796
|
F: __dxlog_file12,
|
|
2757
|
-
L:
|
|
2797
|
+
L: 44,
|
|
2758
2798
|
S: this,
|
|
2759
2799
|
C: (f, a) => f(...a)
|
|
2760
2800
|
});
|
|
2761
2801
|
log11("created connection", params, {
|
|
2762
2802
|
F: __dxlog_file12,
|
|
2763
|
-
L:
|
|
2803
|
+
L: 45,
|
|
2764
2804
|
S: this,
|
|
2765
2805
|
C: (f, a) => f(...a)
|
|
2766
2806
|
});
|
|
@@ -2773,7 +2813,7 @@ var SimplePeerTransport = class {
|
|
|
2773
2813
|
this._peer.on("signal", async (data) => {
|
|
2774
2814
|
log11("signal", data, {
|
|
2775
2815
|
F: __dxlog_file12,
|
|
2776
|
-
L:
|
|
2816
|
+
L: 54,
|
|
2777
2817
|
S: this,
|
|
2778
2818
|
C: (f, a) => f(...a)
|
|
2779
2819
|
});
|
|
@@ -2786,7 +2826,7 @@ var SimplePeerTransport = class {
|
|
|
2786
2826
|
this._peer.on("connect", () => {
|
|
2787
2827
|
log11("connected", void 0, {
|
|
2788
2828
|
F: __dxlog_file12,
|
|
2789
|
-
L:
|
|
2829
|
+
L: 59,
|
|
2790
2830
|
S: this,
|
|
2791
2831
|
C: (f, a) => f(...a)
|
|
2792
2832
|
});
|
|
@@ -2797,7 +2837,7 @@ var SimplePeerTransport = class {
|
|
|
2797
2837
|
this._peer.on("close", async () => {
|
|
2798
2838
|
log11("closed", void 0, {
|
|
2799
2839
|
F: __dxlog_file12,
|
|
2800
|
-
L:
|
|
2840
|
+
L: 66,
|
|
2801
2841
|
S: this,
|
|
2802
2842
|
C: (f, a) => f(...a)
|
|
2803
2843
|
});
|
|
@@ -2812,7 +2852,7 @@ var SimplePeerTransport = class {
|
|
|
2812
2852
|
err
|
|
2813
2853
|
}, {
|
|
2814
2854
|
F: __dxlog_file12,
|
|
2815
|
-
L:
|
|
2855
|
+
L: 77,
|
|
2816
2856
|
S: this,
|
|
2817
2857
|
C: (f, a) => f(...a)
|
|
2818
2858
|
});
|
|
@@ -2821,7 +2861,7 @@ var SimplePeerTransport = class {
|
|
|
2821
2861
|
} else if ("code" in err) {
|
|
2822
2862
|
log11.info("simple-peer error", err, {
|
|
2823
2863
|
F: __dxlog_file12,
|
|
2824
|
-
L:
|
|
2864
|
+
L: 82,
|
|
2825
2865
|
S: this,
|
|
2826
2866
|
C: (f, a) => f(...a)
|
|
2827
2867
|
});
|
|
@@ -2851,7 +2891,7 @@ var SimplePeerTransport = class {
|
|
|
2851
2891
|
} else {
|
|
2852
2892
|
log11.info("unknown peer connection error", err, {
|
|
2853
2893
|
F: __dxlog_file12,
|
|
2854
|
-
L:
|
|
2894
|
+
L: 108,
|
|
2855
2895
|
S: this,
|
|
2856
2896
|
C: (f, a) => f(...a)
|
|
2857
2897
|
});
|
|
@@ -2862,10 +2902,10 @@ var SimplePeerTransport = class {
|
|
|
2862
2902
|
this._peer._pc.getStats().then((stats) => {
|
|
2863
2903
|
log11.info("report after webrtc error", {
|
|
2864
2904
|
config: this.params.webrtcConfig,
|
|
2865
|
-
stats
|
|
2905
|
+
stats: Object.fromEntries(stats.entries())
|
|
2866
2906
|
}, {
|
|
2867
2907
|
F: __dxlog_file12,
|
|
2868
|
-
L:
|
|
2908
|
+
L: 116,
|
|
2869
2909
|
S: this,
|
|
2870
2910
|
C: (f, a) => f(...a)
|
|
2871
2911
|
});
|
|
@@ -2874,7 +2914,7 @@ var SimplePeerTransport = class {
|
|
|
2874
2914
|
} catch (err2) {
|
|
2875
2915
|
log11.catch(err2, void 0, {
|
|
2876
2916
|
F: __dxlog_file12,
|
|
2877
|
-
L:
|
|
2917
|
+
L: 123,
|
|
2878
2918
|
S: this,
|
|
2879
2919
|
C: (f, a) => f(...a)
|
|
2880
2920
|
});
|
|
@@ -2885,15 +2925,68 @@ var SimplePeerTransport = class {
|
|
|
2885
2925
|
id: this._instanceId
|
|
2886
2926
|
}), {
|
|
2887
2927
|
F: __dxlog_file12,
|
|
2888
|
-
L:
|
|
2928
|
+
L: 129,
|
|
2889
2929
|
S: this,
|
|
2890
2930
|
C: (f, a) => f(...a)
|
|
2891
2931
|
});
|
|
2892
2932
|
}
|
|
2933
|
+
async getStats() {
|
|
2934
|
+
const stats = await this._getStats();
|
|
2935
|
+
if (!stats) {
|
|
2936
|
+
return {
|
|
2937
|
+
bytesSent: 0,
|
|
2938
|
+
bytesReceived: 0,
|
|
2939
|
+
packetsSent: 0,
|
|
2940
|
+
packetsReceived: 0,
|
|
2941
|
+
rawStats: {}
|
|
2942
|
+
};
|
|
2943
|
+
}
|
|
2944
|
+
return {
|
|
2945
|
+
bytesSent: stats.transport.bytesSent,
|
|
2946
|
+
bytesReceived: stats.transport.bytesReceived,
|
|
2947
|
+
packetsSent: stats.transport.messagesSent,
|
|
2948
|
+
packetsReceived: stats.transport.messagesReceived,
|
|
2949
|
+
rawStats: stats.raw
|
|
2950
|
+
};
|
|
2951
|
+
}
|
|
2952
|
+
async _getStats() {
|
|
2953
|
+
if (typeof this._peer?._pc?.getStats !== "function") {
|
|
2954
|
+
return null;
|
|
2955
|
+
}
|
|
2956
|
+
return await this._peer._pc.getStats().then((stats) => {
|
|
2957
|
+
const statsEntries = Array.from(stats.entries());
|
|
2958
|
+
const transport = statsEntries.filter((s) => s[1].type === "transport")[0][1];
|
|
2959
|
+
const candidatePair = statsEntries.filter((s) => s[0] === transport.selectedCandidatePairId);
|
|
2960
|
+
let selectedCandidatePair;
|
|
2961
|
+
let remoteCandidate;
|
|
2962
|
+
if (candidatePair.length > 0) {
|
|
2963
|
+
selectedCandidatePair = candidatePair[0][1];
|
|
2964
|
+
remoteCandidate = statsEntries.filter((s) => s[0] === selectedCandidatePair.remoteCandidateId)[0][1];
|
|
2965
|
+
}
|
|
2966
|
+
return {
|
|
2967
|
+
datachannel: statsEntries.filter((s) => s[1].type === "data-channel")[0][1],
|
|
2968
|
+
transport,
|
|
2969
|
+
selectedCandidatePair,
|
|
2970
|
+
remoteCandidate,
|
|
2971
|
+
raw: Object.fromEntries(stats.entries())
|
|
2972
|
+
};
|
|
2973
|
+
});
|
|
2974
|
+
}
|
|
2975
|
+
async getDetails() {
|
|
2976
|
+
const stats = await this._getStats();
|
|
2977
|
+
const rc = stats?.remoteCandidate;
|
|
2978
|
+
if (!rc) {
|
|
2979
|
+
return "unavailable";
|
|
2980
|
+
}
|
|
2981
|
+
if (rc.relay) {
|
|
2982
|
+
return `${rc.ip}:${rc.port}/${rc.protocol} relay for XXX ${rc.candidateType}`;
|
|
2983
|
+
}
|
|
2984
|
+
return `${rc.ip}:${rc.port}/${rc.protocol} ${rc.candidateType}`;
|
|
2985
|
+
}
|
|
2893
2986
|
async destroy() {
|
|
2894
2987
|
log11("closing...", void 0, {
|
|
2895
2988
|
F: __dxlog_file12,
|
|
2896
|
-
L:
|
|
2989
|
+
L: 192,
|
|
2897
2990
|
S: this,
|
|
2898
2991
|
C: (f, a) => f(...a)
|
|
2899
2992
|
});
|
|
@@ -2903,10 +2996,11 @@ var SimplePeerTransport = class {
|
|
|
2903
2996
|
this._closed = true;
|
|
2904
2997
|
this._disconnectStreams();
|
|
2905
2998
|
this._peer.destroy();
|
|
2999
|
+
this._closed = true;
|
|
2906
3000
|
this.closed.emit();
|
|
2907
3001
|
log11("closed", void 0, {
|
|
2908
3002
|
F: __dxlog_file12,
|
|
2909
|
-
L:
|
|
3003
|
+
L: 201,
|
|
2910
3004
|
S: this,
|
|
2911
3005
|
C: (f, a) => f(...a)
|
|
2912
3006
|
});
|
|
@@ -3021,7 +3115,7 @@ var SimplePeerTransportService = class {
|
|
|
3021
3115
|
async sendSignal({ proxyId, signal }) {
|
|
3022
3116
|
invariant12(this.transports.has(proxyId), void 0, {
|
|
3023
3117
|
F: __dxlog_file13,
|
|
3024
|
-
L:
|
|
3118
|
+
L: 116,
|
|
3025
3119
|
S: this,
|
|
3026
3120
|
A: [
|
|
3027
3121
|
"this.transports.has(proxyId)",
|
|
@@ -3030,18 +3124,46 @@ var SimplePeerTransportService = class {
|
|
|
3030
3124
|
});
|
|
3031
3125
|
await this.transports.get(proxyId).transport.signal(signal);
|
|
3032
3126
|
}
|
|
3127
|
+
async getDetails({ proxyId }) {
|
|
3128
|
+
invariant12(this.transports.has(proxyId), void 0, {
|
|
3129
|
+
F: __dxlog_file13,
|
|
3130
|
+
L: 121,
|
|
3131
|
+
S: this,
|
|
3132
|
+
A: [
|
|
3133
|
+
"this.transports.has(proxyId)",
|
|
3134
|
+
""
|
|
3135
|
+
]
|
|
3136
|
+
});
|
|
3137
|
+
return {
|
|
3138
|
+
details: await this.transports.get(proxyId).transport.getDetails()
|
|
3139
|
+
};
|
|
3140
|
+
}
|
|
3141
|
+
async getStats({ proxyId }) {
|
|
3142
|
+
invariant12(this.transports.has(proxyId), void 0, {
|
|
3143
|
+
F: __dxlog_file13,
|
|
3144
|
+
L: 126,
|
|
3145
|
+
S: this,
|
|
3146
|
+
A: [
|
|
3147
|
+
"this.transports.has(proxyId)",
|
|
3148
|
+
""
|
|
3149
|
+
]
|
|
3150
|
+
});
|
|
3151
|
+
return {
|
|
3152
|
+
stats: await this.transports.get(proxyId).transport.getStats()
|
|
3153
|
+
};
|
|
3154
|
+
}
|
|
3033
3155
|
async sendData({ proxyId, payload }) {
|
|
3034
3156
|
if (this.transports.get(proxyId)?.state !== "OPEN") {
|
|
3035
3157
|
log12.debug("transport is closed", void 0, {
|
|
3036
3158
|
F: __dxlog_file13,
|
|
3037
|
-
L:
|
|
3159
|
+
L: 132,
|
|
3038
3160
|
S: this,
|
|
3039
3161
|
C: (f, a) => f(...a)
|
|
3040
3162
|
});
|
|
3041
3163
|
}
|
|
3042
3164
|
invariant12(this.transports.has(proxyId), void 0, {
|
|
3043
3165
|
F: __dxlog_file13,
|
|
3044
|
-
L:
|
|
3166
|
+
L: 134,
|
|
3045
3167
|
S: this,
|
|
3046
3168
|
A: [
|
|
3047
3169
|
"this.transports.has(proxyId)",
|
|
@@ -3064,7 +3186,7 @@ var SimplePeerTransportService = class {
|
|
|
3064
3186
|
}
|
|
3065
3187
|
log12("Closed.", void 0, {
|
|
3066
3188
|
F: __dxlog_file13,
|
|
3067
|
-
L:
|
|
3189
|
+
L: 150,
|
|
3068
3190
|
S: this,
|
|
3069
3191
|
C: (f, a) => f(...a)
|
|
3070
3192
|
});
|
|
@@ -3203,6 +3325,16 @@ var SimplePeerTransportProxy = class {
|
|
|
3203
3325
|
signal
|
|
3204
3326
|
}).catch((err) => this.errors.raise(decodeError(err)));
|
|
3205
3327
|
}
|
|
3328
|
+
async getDetails() {
|
|
3329
|
+
return (await this._params.bridgeService.getDetails({
|
|
3330
|
+
proxyId: this._proxyId
|
|
3331
|
+
})).details;
|
|
3332
|
+
}
|
|
3333
|
+
async getStats() {
|
|
3334
|
+
return (await this._params.bridgeService.getStats({
|
|
3335
|
+
proxyId: this._proxyId
|
|
3336
|
+
})).stats;
|
|
3337
|
+
}
|
|
3206
3338
|
// TODO(burdon): Move open from constructor.
|
|
3207
3339
|
async destroy() {
|
|
3208
3340
|
await this._ctx.dispose();
|
|
@@ -3217,7 +3349,7 @@ var SimplePeerTransportProxy = class {
|
|
|
3217
3349
|
} catch (err) {
|
|
3218
3350
|
log13.catch(err, void 0, {
|
|
3219
3351
|
F: __dxlog_file14,
|
|
3220
|
-
L:
|
|
3352
|
+
L: 168,
|
|
3221
3353
|
S: this,
|
|
3222
3354
|
C: (f, a) => f(...a)
|
|
3223
3355
|
});
|
|
@@ -3253,7 +3385,7 @@ var SimplePeerTransportProxyFactory = class {
|
|
|
3253
3385
|
createTransport(options) {
|
|
3254
3386
|
invariant13(this._bridgeService, "SimplePeerTransportProxyFactory is not ready to open connections", {
|
|
3255
3387
|
F: __dxlog_file14,
|
|
3256
|
-
L:
|
|
3388
|
+
L: 205,
|
|
3257
3389
|
S: this,
|
|
3258
3390
|
A: [
|
|
3259
3391
|
"this._bridgeService",
|
|
@@ -3612,6 +3744,46 @@ var LibDataChannelTransport = class {
|
|
|
3612
3744
|
});
|
|
3613
3745
|
});
|
|
3614
3746
|
}
|
|
3747
|
+
async getDetails() {
|
|
3748
|
+
return this._peer.then(async (peer) => {
|
|
3749
|
+
const cp = await peer.getSelectedCandidatePair();
|
|
3750
|
+
if (!cp) {
|
|
3751
|
+
return "unavailable";
|
|
3752
|
+
}
|
|
3753
|
+
return `${cp.remote.address}:${cp.remote.port}/${cp.remote.transportType} ${cp.remote.type}`;
|
|
3754
|
+
}).catch((err) => {
|
|
3755
|
+
log14.catch(err, void 0, {
|
|
3756
|
+
F: __dxlog_file15,
|
|
3757
|
+
L: 250,
|
|
3758
|
+
S: this,
|
|
3759
|
+
C: (f, a) => f(...a)
|
|
3760
|
+
});
|
|
3761
|
+
return "unavailable";
|
|
3762
|
+
});
|
|
3763
|
+
}
|
|
3764
|
+
async getStats() {
|
|
3765
|
+
return this._peer.then((peer) => {
|
|
3766
|
+
return {
|
|
3767
|
+
bytesSent: peer.bytesSent(),
|
|
3768
|
+
bytesReceived: peer.bytesReceived(),
|
|
3769
|
+
packetsSent: 0,
|
|
3770
|
+
packetsReceived: 0
|
|
3771
|
+
};
|
|
3772
|
+
}).catch((err) => {
|
|
3773
|
+
log14.catch(err, void 0, {
|
|
3774
|
+
F: __dxlog_file15,
|
|
3775
|
+
L: 266,
|
|
3776
|
+
S: this,
|
|
3777
|
+
C: (f, a) => f(...a)
|
|
3778
|
+
});
|
|
3779
|
+
return {
|
|
3780
|
+
bytesSent: 0,
|
|
3781
|
+
bytesReceived: 0,
|
|
3782
|
+
packetsSent: 0,
|
|
3783
|
+
packetsReceived: 0
|
|
3784
|
+
};
|
|
3785
|
+
});
|
|
3786
|
+
}
|
|
3615
3787
|
// TODO(nf): add classmethod to call node-datachannel.cleanup() when all instances have been destroyed?
|
|
3616
3788
|
async destroy() {
|
|
3617
3789
|
await this._close();
|
|
@@ -3648,6 +3820,12 @@ var TcpTransport = class {
|
|
|
3648
3820
|
signal() {
|
|
3649
3821
|
throw new Error("Method not implemented.");
|
|
3650
3822
|
}
|
|
3823
|
+
async getStats() {
|
|
3824
|
+
throw new Error("Method not implemented.");
|
|
3825
|
+
}
|
|
3826
|
+
async getDetails() {
|
|
3827
|
+
throw new Error("Method not implemented.");
|
|
3828
|
+
}
|
|
3651
3829
|
};
|
|
3652
3830
|
|
|
3653
3831
|
// packages/core/mesh/network-manager/src/wire-protocol.ts
|
|
@@ -3657,8 +3835,8 @@ var createTeleportProtocolFactory = (onConnection) => {
|
|
|
3657
3835
|
const teleport = new Teleport(params);
|
|
3658
3836
|
return {
|
|
3659
3837
|
stream: teleport.stream,
|
|
3660
|
-
open: async () => {
|
|
3661
|
-
await teleport.open();
|
|
3838
|
+
open: async (sessionId) => {
|
|
3839
|
+
await teleport.open(sessionId);
|
|
3662
3840
|
await onConnection(teleport);
|
|
3663
3841
|
},
|
|
3664
3842
|
close: async () => {
|
|
@@ -3699,4 +3877,4 @@ export {
|
|
|
3699
3877
|
TcpTransport,
|
|
3700
3878
|
createTeleportProtocolFactory
|
|
3701
3879
|
};
|
|
3702
|
-
//# sourceMappingURL=chunk-
|
|
3880
|
+
//# sourceMappingURL=chunk-HJ6JLRZM.mjs.map
|