peerjs-server icon indicating copy to clipboard operation
peerjs-server copied to clipboard

Possibility of custom emitted events

Open sergeyyurkov1 opened this issue 2 years ago • 4 comments

I have a suggestion:

Because Peer.js server uses sockets under the hood for signalling, it would be great to have the ability to tap into the existing channel and emit custom events that could be accepted on the client side and vice versa (unless I'm missing something and this is already possible). I tried to experiment with EventEmitter's newListener()/addListener() but to no avail (please pardon my inexperience). That would be useful for, say, room management and eliminate the need for opening a second connection (sockets or HTTP) for this sort of thing.

Example: peerServer.emit("test", ...) on the server side -> peer.on("test", ...) on the client.

Thank you.

sergeyyurkov1 avatar Jun 12 '22 08:06 sergeyyurkov1

Hey @sergeyyurkov1, thanks for the request. I’ll put in on the roadmap :)

jonasgloning avatar Jun 12 '22 10:06 jonasgloning

Hey @jonasgloning ,Can I take up this feature as i recently worked on implementing custom events in the modified version of the peerjs

vijayabhaskar-ev avatar Apr 17 '24 13:04 vijayabhaskar-ev

Yes, please!

You can ping @peers/maintainers if you need some help or want some feedback on the way.

But to dampen expectations: our review times are pretty bad right now, so it might take some time to merge your proposal.

jonasgloning avatar Apr 17 '24 14:04 jonasgloning