node-webrtc / node-webrtc-examples

MediaStream and RTCDataChannel examples using node-webrtc
514 stars 161 forks source link

websocket udp #19

Closed vinnitu closed 4 years ago

vinnitu commented 4 years ago

Hello!

I need udp channel data from node server to browser client (now it is tcp with websockets). Is it possibe do with your project? If so can you help me to understand what i need to do?

Thank you!

yandeu commented 4 years ago

I wrote a library which does just that (on top of node-webrtc). It was designed for real time multiplayer games, but you can use it for anything you want. Check it out at geckos.io.

vinnitu commented 4 years ago

perfectly! do you have multicast?

yandeu commented 4 years ago

What do you mean by multicast? Sending some messages only to clients in a certain group? Yes, this is possible by adding the channel to a group with channel.join("some-group-name").

See the cheatsheet with all available methods.

vinnitu commented 4 years ago

maybe I am was not correct really i need https://en.wikipedia.org/wiki/Broadcasting_(networking)

yandeu commented 4 years ago

From the cheatsheet:

// emits a message to all channels
io.emit('chat message', 'Hello everyone!')

It will send a message from the server to all connected clients.

yandeu commented 4 years ago

@vinnitu Is this what you where looking for?