cbmeeks
cbmeeks

Reputation: 11420

How do I setup a PubSub chat system using EventMachine?

I'm trying to learn EventMachine (and become a better, asynchronous programmer). I thought I would go with the classic chat app.

I manged to setup a WebSocket (using em-websocket) server and a WebSocket client. All was great until I realized that most browsers don't support WebSocket! Especially IE. My curse for using Chrome everywhere. lol

So, how can I use EventMachine as my server (to receive incoming messages) and be able to send messages back to subscribed clients?

Plus, I want this to work in any browser.

Thanks for any suggestions.

Upvotes: 0

Views: 665

Answers (2)

Andrew
Andrew

Reputation: 238747

If I am not mistaken, the em-websocket project has an example of a WebSocket client using flash fallback if WebSockets are not available. I haven't actually tried this, so I may be wrong.

Upvotes: 1

dctanner
dctanner

Reputation: 94

We created Pusher (http://pusher.com/) partially to solve this issue of compatibility. We have a flashsocket fallback for non-supported browsers and also support for the different websocket protocol versions. Although you might not need to use EM with Pusher, you might still find it useful for playing with realtime messaging!

Upvotes: 0

Related Questions