@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 +15 -2
- package/dist/index.min.js +18 -18
- package/dist/src/index.d.ts +15 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +15 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/private-to-private/listener.d.ts +1 -0
- package/dist/src/private-to-private/listener.d.ts.map +1 -1
- package/dist/src/private-to-private/listener.js +3 -1
- package/dist/src/private-to-private/listener.js.map +1 -1
- package/dist/src/private-to-public/listener.browser.d.ts +1 -0
- package/dist/src/private-to-public/listener.browser.d.ts.map +1 -1
- package/dist/src/private-to-public/listener.browser.js +2 -0
- package/dist/src/private-to-public/listener.browser.js.map +1 -1
- package/dist/src/private-to-public/listener.d.ts +2 -1
- package/dist/src/private-to-public/listener.d.ts.map +1 -1
- package/dist/src/private-to-public/listener.js +104 -29
- package/dist/src/private-to-public/listener.js.map +1 -1
- package/package.json +13 -11
- package/src/index.ts +15 -2
- package/src/private-to-private/listener.ts +5 -1
- package/src/private-to-public/listener.browser.ts +4 -0
- package/src/private-to-public/listener.ts +131 -31
- package/dist/typedoc-urls.json +0 -14
package/README.md
CHANGED
@@ -162,9 +162,22 @@ await pipe(
|
|
162
162
|
|
163
163
|
## Example - WebRTC Direct
|
164
164
|
|
165
|
-
|
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
|
-
|
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'
|