A
A
Alexander Wolf2015-05-14 02:06:02
Ruby on Rails
Alexander Wolf, 2015-05-14 02:06:02

How to implement long polling in Ruby [on Rails]?

Hey! We have a chat room on our website. It is implemented via web socket. We used the rails-websocket gem.
Recently connected to CloudFlare site which is known to block sockets for non-enterprise users.
It was decided to change sockets to long polling. After googling it was not possible to find gems for this technology.
Please tell me where to dig?
PS: Puma is worth it (if there are suggestions to change to EventMachine based, throw a link to the server :)
PPS: You can, of course, use NodeJS for these purposes, but I would like to keep everything at the level of one language :)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mark, 2015-05-14
@mannaro

You can pull the chat to another domain / bypass CloudFlare, and leave everything else as it is.

S
Shetani, 2015-05-14
@Shetani

Here is an example I found

A
Alexey, 2015-05-15
@fuCtor

And if you use server side events? You can see the implementation here: https://github.com/Shopify/dashing/blob/master/lib...

I
Infinite, 2015-05-18
@Infinite

Here is an option josephndungu.com/tutorials/gmail-like-chat-applica...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question