@libp2p/webrtc 5.1.0-e7e280257 → 5.1.1-754fe84db

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'
@@ -139,9 +139,22 @@
139
139
  *
140
140
  * @example WebRTC Direct
141
141
  *
142
- * At the time of writing WebRTC Direct is dial-only in browsers and unsupported in Node.js.
142
+ * WebRTC Direct allows a client to establish a WebRTC connection to a server
143
+ * without using a relay to first exchange SDP messages.
143
144
  *
144
- * The only implementation that supports a WebRTC Direct listener is go-libp2p and it's not yet enabled by default.
145
+ * Instead the server listens on a public UDP port and embeds its certificate
146
+ * hash in the published multiaddr. It derives the client's SDP offer based on
147
+ * the incoming IP/port of STUN messages sent to this public port.
148
+ *
149
+ * The client derives the server's SDP answer based on the information in the
150
+ * multiaddr so no SDP handshake via a third party is required.
151
+ *
152
+ * 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).
153
+ *
154
+ * Browsers cannot listen on WebRTC Direct addresses since they cannot open
155
+ * ports, but they can dial all spec-compliant servers.
156
+ *
157
+ * Node.js/go and rust-libp2p can listen on and dial WebRTC Direct addresses.
145
158
  *
146
159
  * ```TypeScript
147
160
  * import { createLibp2p } from 'libp2p'
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2LG;AAGH,OAAO,EAAyB,KAAK,yBAAyB,EAAE,KAAK,+BAA+B,EAAE,MAAM,kCAAkC,CAAA;AAC9I,OAAO,KAAK,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;;;;OAMG;IACH,6BAA6B,CAAC,EAAE,MAAM,CAAA;IAEtC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX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;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,YAAY,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,CAAA;AAE1E,iBAAS,YAAY,CAAE,IAAI,CAAC,EAAE,yBAAyB,GAAG,CAAC,UAAU,EAAE,+BAA+B,KAAK,SAAS,CAEnH;AAED,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,CAAA;AAE9D,iBAAS,MAAM,CAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,CAAC,UAAU,EAAE,yBAAyB,KAAK,SAAS,CAEjG;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA"}
package/dist/src/index.js CHANGED
@@ -139,9 +139,22 @@
139
139
  *
140
140
  * @example WebRTC Direct
141
141
  *
142
- * At the time of writing WebRTC Direct is dial-only in browsers and unsupported in Node.js.
142
+ * WebRTC Direct allows a client to establish a WebRTC connection to a server
143
+ * without using a relay to first exchange SDP messages.
143
144
  *
144
- * The only implementation that supports a WebRTC Direct listener is go-libp2p and it's not yet enabled by default.
145
+ * Instead the server listens on a public UDP port and embeds its certificate
146
+ * hash in the published multiaddr. It derives the client's SDP offer based on
147
+ * the incoming IP/port of STUN messages sent to this public port.
148
+ *
149
+ * The client derives the server's SDP answer based on the information in the
150
+ * multiaddr so no SDP handshake via a third party is required.
151
+ *
152
+ * 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).
153
+ *
154
+ * Browsers cannot listen on WebRTC Direct addresses since they cannot open
155
+ * ports, but they can dial all spec-compliant servers.
156
+ *
157
+ * Node.js/go and rust-libp2p can listen on and dial WebRTC Direct addresses.
145
158
  *
146
159
  * ```TypeScript
147
160
  * import { createLibp2p } from 'libp2p'
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2LG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAwE,MAAM,kCAAkC,CAAA;AA2E9I,SAAS,YAAY,CAAE,IAAgC;IACrD,OAAO,CAAC,UAA2C,EAAE,EAAE,CAAC,IAAI,qBAAqB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACrG,CAAC;AAID,SAAS,MAAM,CAAE,IAA0B;IACzC,OAAO,CAAC,UAAqC,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACzF,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAwE,MAAM,kCAAkC,CAAA;AA2E9I,SAAS,YAAY,CAAE,IAAgC;IACrD,OAAO,CAAC,UAA2C,EAAE,EAAE,CAAC,IAAI,qBAAqB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACrG,CAAC;AAID,SAAS,MAAM,CAAE,IAA0B;IACzC,OAAO,CAAC,UAAqC,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACzF,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/webrtc",
3
- "version": "5.1.0-e7e280257",
3
+ "version": "5.1.1-754fe84db",
4
4
  "description": "A libp2p transport using WebRTC connections",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webrtc#readme",
@@ -54,10 +54,10 @@
54
54
  "@chainsafe/is-ip": "^2.0.2",
55
55
  "@chainsafe/libp2p-noise": "^16.0.0",
56
56
  "@ipshipyard/node-datachannel": "^0.26.4",
57
- "@libp2p/interface": "2.5.0-e7e280257",
58
- "@libp2p/interface-internal": "2.3.0-e7e280257",
59
- "@libp2p/peer-id": "5.0.12-e7e280257",
60
- "@libp2p/utils": "6.5.1-e7e280257",
57
+ "@libp2p/interface": "2.5.0-754fe84db",
58
+ "@libp2p/interface-internal": "2.3.1-754fe84db",
59
+ "@libp2p/peer-id": "5.0.12-754fe84db",
60
+ "@libp2p/utils": "6.5.1-754fe84db",
61
61
  "@multiformats/multiaddr": "^12.3.3",
62
62
  "@multiformats/multiaddr-matcher": "^1.6.0",
63
63
  "@peculiar/webcrypto": "^1.5.0",
@@ -83,9 +83,9 @@
83
83
  "uint8arrays": "^5.1.0"
84
84
  },
85
85
  "devDependencies": {
86
- "@libp2p/crypto": "5.0.11-e7e280257",
87
- "@libp2p/interface-compliance-tests": "6.3.0-e7e280257",
88
- "@libp2p/logger": "5.1.8-e7e280257",
86
+ "@libp2p/crypto": "5.0.11-754fe84db",
87
+ "@libp2p/interface-compliance-tests": "6.3.1-754fe84db",
88
+ "@libp2p/logger": "5.1.8-754fe84db",
89
89
  "@types/sinon": "^17.0.3",
90
90
  "aegir": "^45.0.5",
91
91
  "delay": "^6.0.0",
package/src/index.ts CHANGED
@@ -139,9 +139,22 @@
139
139
  *
140
140
  * @example WebRTC Direct
141
141
  *
142
- * At the time of writing WebRTC Direct is dial-only in browsers and unsupported in Node.js.
142
+ * WebRTC Direct allows a client to establish a WebRTC connection to a server
143
+ * without using a relay to first exchange SDP messages.
143
144
  *
144
- * The only implementation that supports a WebRTC Direct listener is go-libp2p and it's not yet enabled by default.
145
+ * Instead the server listens on a public UDP port and embeds its certificate
146
+ * hash in the published multiaddr. It derives the client's SDP offer based on
147
+ * the incoming IP/port of STUN messages sent to this public port.
148
+ *
149
+ * The client derives the server's SDP answer based on the information in the
150
+ * multiaddr so no SDP handshake via a third party is required.
151
+ *
152
+ * 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).
153
+ *
154
+ * Browsers cannot listen on WebRTC Direct addresses since they cannot open
155
+ * ports, but they can dial all spec-compliant servers.
156
+ *
157
+ * Node.js/go and rust-libp2p can listen on and dial WebRTC Direct addresses.
145
158
  *
146
159
  * ```TypeScript
147
160
  * import { createLibp2p } from 'libp2p'