Skip to content

Commit 4521cf1

Browse files
authored
docs: update webrtc example (#2777)
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.
1 parent e6b4158 commit 4521cf1

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

packages/transport-webrtc/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,15 @@ const relay = await createLibp2p({
9797
// WebRTC connections
9898
const listener = await createLibp2p({
9999
addresses: {
100-
listen: ['/webrtc']
100+
listen: [
101+
'/p2p-circuit',
102+
'/webrtc'
103+
]
101104
},
102105
transports: [
103106
webSockets({filter: filters.all}),
104107
webRTC(),
105-
circuitRelayTransport({
106-
discoverRelays: 1
107-
})
108+
circuitRelayTransport()
108109
],
109110
connectionEncrypters: [noise()],
110111
streamMuxers: [yamux()],

packages/transport-webrtc/src/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@
7474
* // WebRTC connections
7575
* const listener = await createLibp2p({
7676
* addresses: {
77-
* listen: ['/webrtc']
77+
* listen: [
78+
* '/p2p-circuit',
79+
* '/webrtc'
80+
* ]
7881
* },
7982
* transports: [
8083
* webSockets({filter: filters.all}),
8184
* webRTC(),
82-
* circuitRelayTransport({
83-
* discoverRelays: 1
84-
* })
85+
* circuitRelayTransport()
8586
* ],
8687
* connectionEncrypters: [noise()],
8788
* streamMuxers: [yamux()],

0 commit comments

Comments
 (0)