[erlang-questions] Recommendations for secure websocket + fallbacks

José Valim jose.valim@REDACTED
Thu Jan 28 15:51:56 CET 2016

Hi Lyn,

I usually avoid posting Elixir related solutions in here but, if Elixir is
an option, you should take a look at Phoenix:

Phoenix is a framework running on top of Cowboy and has a feature called
channels that seems to provide what you are looking for:

* Handle websockets and fallback to long-polling when websockets is not
* Support cross-origin headers in both websockets and long-polling
* Good browser compatibility (our long-polling implementation supports way
back to IE8)
* Ability to "force" SSL, allowing only https/ws connections

Channels run on top of a pubsub system, which allows anywhere in your
application to broadcast messages to all connected clients on a given
topic. We have recently written on how we got 2 million websocket
connections on a single machine (at an arrival rate of 20k/s iirc).

Finally, the pubsub system is distributed. So if you want to deploy over
multiple machines, we will use Distributed Erlang. No need for Redis. We
are also working on a Phoenix Presence feature, using CRDTs alongside
Distributed Erlang, so if you need presence support in the future, it will
be handy too.

If you are interested in more information, you can try the Phoenix guides
<http://www.phoenixframework.org/docs/overview>, the mailing list
<https://groups.google.com/forum/#!forum/phoenix-talk> or join us on
#elixir-lang on IRC Freenode.

*José Valim*
Skype: jv.ptec
Founder and Director of R&D

On Thu, Jan 28, 2016 at 2:00 AM, Lyn Headley <lheadley@REDACTED> wrote:

> I am developing a web app that will use client-side js code that I am
> writing to issue cross-origin requests from a domain not under my
> control to a web server under my control; and am evaluating whether to
> use websockets, long-polling, or another method. I need to consider
> things like browser compatibility (the more browsers supported, the
> better) and security (requests / packets must be secure, so https or
> wss I think). My ideal solution will support low latency messaging and
> high scalability, but will also support most browsers, and be easy to
> install and configure. One tactic for example would be to prefer
> websockets, but fall back to long-polling, which is what I understand
> socket.io does.
> I would be interested to hear any experiences you might have in this
> domain, and any recommendations you might have for erlang libraries,
> servers, etc. Has anyone done this? What stack did you deploy? What
> were the issues you encountered?
> I have a slight bias in favor of yaws, because I have already gotten
> it running, but am open to other web servers if it turns out to be too
> hard to make yaws do what I want.
> Thanks,
> Lyn
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160128/c87932ed/attachment.htm>

More information about the erlang-questions mailing list