libp2p Browser PubSub example

This example demonstrates the pubsub API running in a browser

  1. Start a relay using the command line:
    $ node ./relay.js
    Relay listening on multiaddr(s):  [
      '${multiaddr}'
    ]
          
  2. Copy the relay's multiaddr and use the "Dial Multaddr" section to dial the relay
  3. Wait for a WebRTC address to appear in the "Listening Addresses" area
  4. Open the same page in another browser window
  5. Use the "Dial Multiaddr" section in the second window to dial the WebRTC address from the first
  6. Subscribe both windows to the same topic using the "PubSub" section
  7. Send messages between the windows using the "PubSub" section

Node

PeerId

Listening Addresses

Connected Peers


PubSub

Topic Peers


Output