@libp2p/webrtc 1.1.5 → 1.1.6
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 +4 -24
- package/dist/index.min.js +16 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,30 +75,10 @@ Examples can be found in the [examples folder](examples/README.md).
|
|
|
75
75
|
|
|
76
76
|

|
|
77
77
|
|
|
78
|
-
Browsers can only `dial`,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
[Symbol.toStringTag]: string
|
|
83
|
-
[symbol]: true
|
|
84
|
-
dial: (ma: Multiaddr, options: DialOptions) => Promise<Connection>
|
|
85
|
-
createListener: (options: CreateListenerOptions) => Listener
|
|
86
|
-
filter: MultiaddrFilter
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
class WebRTCTransport implements Transport {
|
|
90
|
-
|
|
91
|
-
async dial (ma: Multiaddr, options: WebRTCDialOptions): Promise<Connection> {
|
|
92
|
-
const rawConn = await this._connect(ma, options)
|
|
93
|
-
log(`dialing address - ${ma.toString()}`)
|
|
94
|
-
return rawConn
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
createListener (options: CreateListenerOptions): Listener {
|
|
98
|
-
throw unimplemented('WebRTCTransport.createListener')
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
```
|
|
78
|
+
Browsers can usually only `dial`, but `listen` is supported in the WebRTC
|
|
79
|
+
transport when paired with another listener like CircuitV2, where you listen on
|
|
80
|
+
a relayed connection. Take a look at [index.js](examples/browser-to-browser/index.js) for
|
|
81
|
+
an example.
|
|
102
82
|
|
|
103
83
|
### Connection
|
|
104
84
|
|