Updates
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/** Pair two SecretStream instances in-process (Protomux-style loopback). */
|
||||
function pairSecretStreams (initiator, responder) {
|
||||
initiator.rawStream.pipe(responder.rawStream).pipe(initiator.rawStream)
|
||||
}
|
||||
|
||||
async function waitSecretStreamsConnected (...streams) {
|
||||
await Promise.all(streams.map((s) => s.opened))
|
||||
}
|
||||
|
||||
module.exports = { pairSecretStreams, waitSecretStreamsConnected }
|
||||
Reference in New Issue
Block a user