Comments (3)
Agreed here (except about peerDependencies, those are just as evil as optionalDependencies). This is an unwanted feature except when I want node support and is highly likely to fail (I still haven't got the build to actually work yet, which fails the entire package install). What about a separate package for node support? optionalDependencies are just not reliable.
An alternative might be to pass wrtc
in as a parameter:
var SimplePeer = require('simple-peer')
var peer1 = new SimplePeer({ initiator: true, webrtc: require('wrtc') })
var peer2 = new SimplePeer({ webrtc: require('wrtc') })
Then in the readme just state that if you want node support, you should pass in opts.webrtc
yourself. This also makes the backend implementation swappable so that if something better comes along (like a pure js version) it'll be easy to switch.
from simple-peer.
Version 5.0.0 removes the wrtc
dependency. Instead, you must now pass it in like:
var SimplePeer = require('simple-peer')
var wrtc = require('wrtc')
var peer1 = new SimplePeer({ initiator: true, wrtc: wrtc })
var peer2 = new SimplePeer({ wrtc: wrtc })
from simple-peer.
👍
from simple-peer.
Related Issues (20)
- Upgrade dependency readable-stream to v4 HOT 1
- The sample code does not work properly
- Is it possible to provide a token in simple-peer opts HOT 3
- No connection when hosted, but locally ok HOT 1
- Fixing addStream() deprecation HOT 3
- RTCPeerconnection failed on mobile device and on Mac HOT 3
- MException: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Called in wrong state: stable ( HOT 1
- npm install simple-server fails
- Discussions HOT 1
- So many seemingly dangling peer connections, even if no peer is open HOT 6
- Video and audio are not working after upgrade from react native 0.68.2 to 0.72.6 HOT 1
- Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11
- Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11 HOT 3
- Support renegotiate when adding new media stream HOT 1
- simple-peer won't connect when clients are not in the same network HOT 15
- 'stun:global.stun.twilio.com:3478?transport=udp' is not a valid stun or turn URL on calling new SimplePeer() HOT 2
- simple-peer.js?v=eb7dd428:571 Uncaught (in promise) Error: Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11 at oldBrowser (simple-peer.js?v=eb7dd428:571:13) at new _Peer (simple-peer.js?v=eb7dd428:5966:20) at prepareNewPeerConnection (webRTCHandler.js:59:29) at Socket2.<anonymous> (socketConnection.js:58:5) at Emitter.emit (socket__io-client.js?v=77d8b3f1:427:21) at Socket2.emitEvent (socket__io-client.js?v=77d8b3f1:2731:16) at Socket2.onevent (socket__io-client.js?v=77d8b3f1:2719:12) at Socket2.onpacket (socket__io-client.js?v=77d8b3f1:2690:14) at Emitter.emit (socket__io-client.js?v=77d8b3f1:427:21) at socket__io-client.js?v=77d8b3f1:3287:12 i m getting this error while using react vite please can anybody solve this error i m stuck HOT 3
- Vite-React-Typescript Issue - Uncaught TypeError: Stream is undefined at the time of createing SimplePeer object HOT 3
- Connection is killed if string is too big
- No support for addStream deprecated method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-peer.