becvert / cordova-plugin-websocket-server

Cordova WebSocket Server Plugin
MIT License
84 stars 35 forks source link

How to broadcast message to all client using current web-socket server? #51

Closed Danijel-Mekiho closed 6 years ago

Danijel-Mekiho commented 6 years ago

I have setup one device as a web-socket server and I'm going to broadcast message to 5~10 client devices. But there isn't any function to implement above one in this plugin. Please give me your opinion.

becvert commented 6 years ago

for now, keep the connection objects from the onOpen handler in an array and then loop the array and use send with the connections. I may add a broadcast method in the future that would do exactly that.