Galah
Plug and HTTP Persistent Connections
Hi everyone,
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,
Matthew
Marked As Solved
josevalim
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).
Also Liked
cs-victor-nascimento
@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?
Thanks ![]()
Galah
Thanks,
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!
Regards,
Matthew
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








