Skip to content

Commit

Permalink
docs: update webrtc example
Browse files Browse the repository at this point in the history
Updates example to incorporate changes from #2776

This is done in a separate PR because doing it in #2776 would cause
a major of `@libp2p/webrtc` to be released.
  • Loading branch information
achingbrain committed Oct 22, 2024
1 parent e6b4158 commit af3dd1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions packages/transport-webrtc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,15 @@ const relay = await createLibp2p({
// WebRTC connections
const listener = await createLibp2p({
addresses: {
listen: ['/webrtc']
listen: [
'/p2p-circuit',
'/webrtc'
]
},
transports: [
webSockets({filter: filters.all}),
webRTC(),
circuitRelayTransport({
discoverRelays: 1
})
circuitRelayTransport()
],
connectionEncrypters: [noise()],
streamMuxers: [yamux()],
Expand Down
9 changes: 5 additions & 4 deletions packages/transport-webrtc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@
* // WebRTC connections
* const listener = await createLibp2p({
* addresses: {
* listen: ['/webrtc']
* listen: [
* '/p2p-circuit',
* '/webrtc'
* ]
* },
* transports: [
* webSockets({filter: filters.all}),
* webRTC(),
* circuitRelayTransport({
* discoverRelays: 1
* })
* circuitRelayTransport()
* ],
* connectionEncrypters: [noise()],
* streamMuxers: [yamux()],
Expand Down

0 comments on commit af3dd1e

Please sign in to comment.