Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility of custom emitted events #283

Open
sergeyyurkov1 opened this issue Jun 12, 2022 · 4 comments
Open

Possibility of custom emitted events #283

sergeyyurkov1 opened this issue Jun 12, 2022 · 4 comments

Comments

@sergeyyurkov1
Copy link

sergeyyurkov1 commented Jun 12, 2022

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.

@jonasgloning
Copy link
Member

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

@vijayabhaskar-ev
Copy link

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

@jonasgloning
Copy link
Member

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.

@vijayabhaskar-ev
Copy link

vijayabhaskar-ev commented Jun 2, 2024

@jonasgloning @sergeyyurkov1 @irgalamarr @igrigorik I need some clarification. The user should be able to emit and listen from both server side and client side. Right? And also should i write my own wrapper for custom events using web socket or can we consider using socket.io?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants