I was wondering how Plug deals with HTTP persistent connections?
I have looked through the documentation but I can’t find anything mentioning it. I fear this means that the answer might be that “it doesn’t”. If it doesn’t then what Elixir/Erlang HTTP client and server can I use to get persistent connections?
Thanks in advance,
That’s completely up to the web server. Cowboy, which is what Plug uses by default, will use keep-alive when possible unless you explicitly close the connection (or the current request fails).
@josevalim Sorry to hijack the thread but what about Websocket and/or HTTP2? They are not simply reusing the socket for req/res cycles. They are channels. Will the Phoenix Channel API be ported to Plug once cowboy 2.0 final is out?
I will have a look at the underlying web server.
I am really enjoying learning Elixir. I think you have done a fantastic job. Keep going!