@libp2p/webrtc 5.1.1 → 5.2.0-1ab50cc0d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -162,9 +162,22 @@ await pipe(
162
162
 
163
163
  ## Example - WebRTC Direct
164
164
 
165
- At the time of writing WebRTC Direct is dial-only in browsers and unsupported in Node.js.
165
+ WebRTC Direct allows a client to establish a WebRTC connection to a server
166
+ without using a relay to first exchange SDP messages.
166
167
 
167
- The only implementation that supports a WebRTC Direct listener is go-libp2p and it's not yet enabled by default.
168
+ Instead the server listens on a public UDP port and embeds its certificate
169
+ hash in the published multiaddr. It derives the client's SDP offer based on
170
+ the incoming IP/port of STUN messages sent to this public port.
171
+
172
+ The client derives the server's SDP answer based on the information in the
173
+ multiaddr so no SDP handshake via a third party is required.
174
+
175
+ Full details of the connection protocol can be found in the [WebRTC Direct spec](https://github.com/libp2p/specs/blob/master/webrtc/webrtc-direct.md).
176
+
177
+ Browsers cannot listen on WebRTC Direct addresses since they cannot open
178
+ ports, but they can dial all spec-compliant servers.
179
+
180
+ Node.js/go and rust-libp2p can listen on and dial WebRTC Direct addresses.
168
181
 
169
182
  ```TypeScript
170
183
  import { createLibp2p } from 'libp2p'