Import packages/plugin/src/connection-controller.ts
This commit is contained in:
parent
1b07c25a60
commit
698af5b622
|
|
@ -16,7 +16,9 @@ interface ActiveConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PeerConnectionContext {
|
export interface PeerConnectionContext {
|
||||||
|
peerIdentityKey?: string
|
||||||
transportMode?: () => AuthenticatedPeerChannel['mode']
|
transportMode?: () => AuthenticatedPeerChannel['mode']
|
||||||
|
createTransportUpgradeHost?: AuthenticatedPeerChannel['createTransportUpgradeHost']
|
||||||
connectionId: string
|
connectionId: string
|
||||||
peerDeviceId: string
|
peerDeviceId: string
|
||||||
}
|
}
|
||||||
|
|
@ -89,7 +91,7 @@ export class ConnectionController {
|
||||||
await Promise.all(replaced.map(connection => this.disconnect(connection, 'CONNECTION_REPLACED')))
|
await Promise.all(replaced.map(connection => this.disconnect(connection, 'CONNECTION_REPLACED')))
|
||||||
|
|
||||||
const router = this.createRouter(
|
const router = this.createRouter(
|
||||||
{ connectionId, peerDeviceId: channel.peerDeviceId, transportMode: () => channel.mode },
|
{ connectionId, peerDeviceId: channel.peerDeviceId, peerIdentityKey: channel.peerIdentityKey, transportMode: () => channel.mode, createTransportUpgradeHost: channel.createTransportUpgradeHost?.bind(channel) },
|
||||||
message => this.sendTo(connectionId, channel, message),
|
message => this.sendTo(connectionId, channel, message),
|
||||||
)
|
)
|
||||||
const connection: ActiveConnection = {
|
const connection: ActiveConnection = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue