libp2p Browser PubSub example
This example demonstrates the pubsub API running in a browser
- Start a relay using the command line:
$ node ./relay.js
Relay listening on multiaddr(s): [
'${multiaddr}'
]
- Copy the relay's multiaddr and use the "Dial Multaddr" section to dial the relay
- Wait for a WebRTC address to appear in the "Listening Addresses" area
- Open the same page in another browser window
- Use the "Dial Multiaddr" section in the second window to dial the WebRTC address from the first
- Subscribe both windows to the same topic using the "PubSub" section
- Send messages between the windows using the "PubSub" section