You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.
var isListener = false
var ms = new MultiStream('/ipfs/protocol/1.0.0')
var spdy = new SpdyMuxer(isListener)
// internally there is a multistream handshake to upgrade this transport to spdy muxing
transport.pipe(spdy).pipe(transport)
someDuplex
.pipe(ms) // to handshake the protocol we want to speak through the muxed stream
.pipe(spdy.createStream()) // mux a new stream
.pipe(ms) // confirm the handshake
.pipe(someDuplex)
and from listener end
var isListener = true
var ms = new MultiStream('/ipfs/protocol/1.0.0', function handler(stream) {
// your handler code for this protocol
})
// we can have more than one handler on a MultiStream simply by calling ms.addHandler(protocol, handlerFunc)
var spdy = new SpdyMuxer(isListener)
// we get the multistream handshake into spdy internally
transport.pipe(spdy).pipe(transport)
spdy.on('stream', function (stream) {
// this would start the multistream handshake on this stream
stream.pipe(ms).pipe(stream)
})
The text was updated successfully, but these errors were encountered:
multistream-select and libp2p-spdy can get a lot simpler (and nicer!) once spdy-transport starts returning a duplex stream, so that we have:
from the dialer end
and from listener end
The text was updated successfully, but these errors were encountered: