@thaunknown/simple-peer [![coveralls][coveralls-image]][coveralls-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
[coveralls-image]: https://coveralls.io/repos/github/thaunknown/simple-peer/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/github/thaunknown/simple-peer?branch=master
[npm-image]: https://img.shields.io/npm/v/@thaunknown/simple-peer.svg
[npm-url]: https://npmjs.org/package/@thaunknown/simple-peer
[downloads-image]: https://img.shields.io/npm/dm/@thaunknown/simple-peer.svg
[downloads-url]: https://npmjs.org/package/@thaunknown/simple-peer
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com
#### Simple WebRTC video, voice, and data channels
This package is a more up to date version of feross's simple-peer, it does away with node:stream and node:buffer in favor of streamx and Uint8Array, making the module a lot smaller, additionally it provides
@thaunknown/simple-peer/lite.js which is the same peer implementation, but without MediaTrack and MediaStream handling, just pure Uint8/String data.
It's fully backwards compatible with feross's version.
features
- concise,
node.js style API for
WebRTC
-
works in node and the browser!
- supports
video/voice streams
- supports
data channel
- text and binary data
- node.js
duplex stream interface
- supports advanced options like:
- enable/disable
trickle ICE candidates
- manually set config options
- transceivers and renegotiation
This package is used by
WebTorrent and
many others.
-
install
-
examples
*
A simpler example
*
data channels
*
video/voice
*
dynamic video/voice
*
in node
-
api
-
events
-
error codes
-
connecting more than 2 peers?
-
memory usage
-
connection does not work on some networks?
-
Who is using simple-peer?
-
license
install
``
npm install simple-peer
`
This package works in the browser with browserify. If
you do not use a bundler, you can use the simplepeer.min.js
standalone script
directly in a