Peerjs: Support node.js clients

Created on 17 Dec 2019  ·  10Comments  ·  Source: peers/peerjs

I'd like to build a node.js system that uses web rtc, but I'm noticing that this library doesn't support node.js. Are there any plans to support node.js?

help wanted new feature

Most helpful comment

Just to let people know, you can kinda get PeerJS (as much as a v.late test between two computers proves) working on node with a few hours hacking. Essentially boiled down to swapping out dependencies for binarypack, filereader, node-blob, node-fetch, ws, and wrtc. My repo is here although it in absolutely no state to release.

Please keep the signaling! It's the reason I've come over to this project because it's exactly what I'm looking for. Many thanks for your effort here, I'll try turn all this into a PR that helps.

PS really sorry for removing the opencollective! It's just it broke my windows install step, nothing personal, I'll obviously put it back after.

All 10 comments

Currently I have no time to implement it. Any PRs about it are welcome:)

On a related topic. Does it make sense to consider pulling simple-peer into peerjs client? Its actively maintained and supports nodejs
https://github.com/feross/simple-peer

However its a standalone peer without any signaling modules, which is where peerjs shines with the built in ability to talk to peerjs server.

It isn't so hard as I imagined. I'll try to get it works in the next year.

Sounds great. I’ll keep pressing on with the python port and will keep you updated.

Just to let people know, you can kinda get PeerJS (as much as a v.late test between two computers proves) working on node with a few hours hacking. Essentially boiled down to swapping out dependencies for binarypack, filereader, node-blob, node-fetch, ws, and wrtc. My repo is here although it in absolutely no state to release.

Please keep the signaling! It's the reason I've come over to this project because it's exactly what I'm looking for. Many thanks for your effort here, I'll try turn all this into a PR that helps.

PS really sorry for removing the opencollective! It's just it broke my windows install step, nothing personal, I'll obviously put it back after.

I'm confused, isn't this hack supposed to work? See: https://github.com/peers/peerjs/issues/396#issuecomment-333287381

The strength of PeerJS seems to be the built-in signalling server. Sadly, for my use case it is essential to support nodejs. Has there been any progress towards supporting nodejs, or using simple-peer (https://github.com/feross/simple-peer)? Unfortunately I know way too little about WebRTC to help on this issue (as I have experienced in trying to get one of the "easy" webRTC libraries working), otherwise I could take a stab at integrating "simple-peer" with the peerjs-server myself.

@afrokick

I think it would be a great idea to use simple-peer as a dependency of this project, and have this project primarily maintain the signaling server part of things. The work this module has done that overlaps with simple-peer could be merged in to that. As long as the philosophy of the projects (or owners) don't conflict, then it should be a pretty big win for making them both easier to maintain and advance. It sounds like maintenance of webRTC related stuff is a pretty heavy load - looks like there are a lot of new developments actively happening still.

For anyone interested I've started building a prototype of simple-peerjs (uses exchange signaling by the _PeerJs_ protocol and then uses simple-peer). Currently, it works, although, it lacks the stream implementation.

@NickCis That's great! I've gone a different route and created a WebRTC implementation using simple-peer and RPEP here: https://github.com/fresheneesz/decentral/blob/master/src/node_modules/rpep-webrtc/rpep-webrtc.js. The signal server is done with an RPEP api that uses websockets as the underlying transport. At some point I'll want to extract that into a proper independent repository.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nhducseuit picture nhducseuit  ·  5Comments

jameshfisher picture jameshfisher  ·  6Comments

kidandcat picture kidandcat  ·  8Comments

RikdeVos picture RikdeVos  ·  6Comments

senihtosun picture senihtosun  ·  5Comments