Skip to content

Commit 4197ac0

Browse files
committed
fix: update protocol reference in stream handling example
1 parent 43136b4 commit 4197ac0

File tree

1 file changed

+2
-2
lines changed
  • examples/js-libp2p-example-protocol-and-stream-muxing

1 file changed

+2
-2
lines changed

examples/js-libp2p-example-protocol-and-stream-muxing/2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ await node1.peerStore.patch(node2.peerId, {
3131
multiaddrs: node2.getMultiaddrs()
3232
})
3333

34-
node2.handle(['/a', '/b'], ({ protocol, stream }) => {
34+
node2.handle(['/a', '/b'], ({ stream }) => {
3535
pipe(
3636
stream,
3737
async function (source) {
3838
for await (const msg of source) {
39-
console.log(`from: ${protocol}, msg: ${uint8ArrayToString(msg.subarray())}`)
39+
console.log(`from: ${stream.protocol}, msg: ${uint8ArrayToString(msg.subarray())}`)
4040
}
4141
}
4242
).finally(() => {

0 commit comments

Comments
 (0)