We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43136b4 commit 4197ac0Copy full SHA for 4197ac0
examples/js-libp2p-example-protocol-and-stream-muxing/2.js
@@ -31,12 +31,12 @@ await node1.peerStore.patch(node2.peerId, {
31
multiaddrs: node2.getMultiaddrs()
32
})
33
34
-node2.handle(['/a', '/b'], ({ protocol, stream }) => {
+node2.handle(['/a', '/b'], ({ stream }) => {
35
pipe(
36
stream,
37
async function (source) {
38
for await (const msg of source) {
39
- console.log(`from: ${protocol}, msg: ${uint8ArrayToString(msg.subarray())}`)
+ console.log(`from: ${stream.protocol}, msg: ${uint8ArrayToString(msg.subarray())}`)
40
}
41
42
).finally(() => {
0 commit comments