[erlang-questions] Mochiwebsockets was Re: Long polling

Loïc Hoguin <>
Fri Jul 20 09:11:00 CEST 2012

On 07/20/2012 08:39 AM, Gleb Peregud wrote:
> On Fri, Jul 20, 2012 at 12:46 AM, Loïc Hoguin <> wrote:
>> You don't need a "socket server", whatever that is, you can just use
>> websockets directly in Cowboy, or if you need a long polling fallback
>> there's Bullet available, which is just a library of one module + one js
>> file really. Either way they don't try to anticipate your needs, they just
>> transport data.
> There are few basic questions which are very important here to decide
> which approach to use:
> 1) Do you plan to use it cross-domain or just on one domain?
> 2) Do you want to have as low latency as possible on every browser? Or not?
> 3) Are you interested in just one-directional server-to-client push?
> Or in both directions?
> 4) Do you need fast and robust connection error detection?
> 5) Do you use jQuery already? How large JS library will you tolerate?
> 6) How large server-side library will you tolerate?
> If you don't care about latency that much and you are dealing with
> just one domain - probably Cowboy + Bullet would be easiest to use.
> If you care about latency in all browser and you have to work
> cross-domain - probably SockJS would be the best solution.

Why? I don't see any reason why SockJS would have better latency. And 
for cross-domain, it's just a matter of sending one header.

 > If you want
> to port server-side part of SockJS logic into your app, it should be
> pretty straightforward and I can help you with it.
> IMO in a long run it is probably a good idea to switch to Cowboy (and
> Mochicow) would help you a lot with the switch.

Loïc Hoguin
Erlang Cowboy
Nine Nines

More information about the erlang-questions mailing list