[erlang-questions] Recommendations for secure websocket + fallbacks

Tristan Sloughter <>
Fri Jan 29 15:47:36 CET 2016


I just wanted to second the Phoenix suggestion as someone who isn't even an Elixir user, so José doesn't feel bad suggesting it here :)

Unless you are really just being an HTTP API on top of something, in
which case webmachine is great but if you want websockets you'll have to
use something else like elli or cowboy directly, I always suggest going
with Phoenix to anyone who asks.

Of course, if you can move your needs even higher up you could go
with Zotonic.

Not only is the momentum with Phoenix but I've never felt Erlang the
language itself is able to provide the abstractions necessary for
building webapps efficiently.

--
Tristan Sloughter

 
 
 
On Thu, Jan 28, 2016, at 08:51 AM, José Valim wrote:
> Hi Lyn,
>  
> I usually avoid posting Elixir related solutions in here but, if Elixir is an option, you should take a look at Phoenix: http://www.phoenixframework.org/
>  
> 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 available
> * Support cross-origin headers in both websockets and long-polling transports
> * 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[1], the mailing list[2] or join us on #elixir-lang on IRC Freenode.
>  
>  
>  
> *José Valim*
>  
> www.plataformatec.com.br[3]
> Skype: jv.ptec
> Founder and Director of R&D
>  
>  
>  
> On Thu, Jan 28, 2016 at 2:00 AM, Lyn Headley <> 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
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
> _________________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
 


Links:

  1. http://www.phoenixframework.org/docs/overview
  2. https://groups.google.com/forum/#!forum/phoenix-talk
  3. http://www.plataformatec.com.br/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160129/4f3802ae/attachment.html>


More information about the erlang-questions mailing list