broadcasting to all clients with sockjs

568 views
Skip to first unread message

rem...@gmail.com

unread,
Oct 18, 2013, 5:04:38 PM10/18/13
to soc...@googlegroups.com
I was using socket.io for few months but due to its not working well with AVs and firewalls I heard about sockjs 
but when I tried to implement messaging system with chucktjs its not working 
how can I have custom events like in socket.io so I can send events to all clients 

Ngoc Dao

unread,
Oct 22, 2013, 2:17:54 AM10/22/13
to soc...@googlegroups.com
SockJS just gives you WebSocket API.

The API itself is very simple:
https://github.com/ngocdaothanh/sockjs-client#example


> send events to all clients

With SockJS, you have total freedom to implement other things on you server side.

For your "send events to all clients " problem, for example, if you use Nodejs, you can use Redis to add pubsub to your server side:
* Create a channel
* All clients subscribe to the channel
* Publish xxx to the channel
* Subscribers are notified about xxx, they use SockJS to send xxx to all clients

Zip Zit

unread,
Nov 7, 2013, 2:01:22 AM11/7/13
to soc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages