Unable to destroy peer object
See original GitHub issueI have a peer object defined as var peer = new Peer()
Calling peer.destroy()
leads to the error:
ReferenceError: process is not defined at emitReadable (_stream_readable.js:529) at onEofChunk (_stream_readable.js:506) at readableAddChunk (_stream_readable.js:255) at Peer.push…/node_modules/simple-peer/node_modules/readable-stream/lib/_stream_readable.js.Readable.push (_stream_readable.js:241) at Peer._destroy (index.js:408) at Peer.destroy (index.js:398) at Socket.<anonymous> (sender.component.ts:88) at Socket.push…/node_modules/ngx-socket-io/node_modules/component-emitter/index.js.Emitter.emit (index.js:133) at Socket.push…/node_modules/ngx-socket-io/node_modules/socket.io-client/lib/socket.js.Socket.onevent (socket.js:278) at Socket.push…/node_modules/ngx-socket-io/node_modules/socket.io-client/lib/socket.js.Socket.onpacket (socket.js:23).
What I’m trying to achieve is if a remote client refreshes the browser, I want all other clients to destroy the connection to that remote client.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:11
Top GitHub Comments
For simple-peer to work correctly in angular you need some polyfills. Add this to your
polyfills.ts
file:And install this package: https://www.npmjs.com/package/process
It works! Thank you.