9

I know that Cowboy is capable of handling SPDY protocol (not HTTP2, though). However, looking into Phoenix framework source code, I only see http and https calls. Is SPDY ignored? It's pity to have my Elixir/Phoenix site serves pages slower than its old Rails incarnation just because Apache/Passenger used SPDY and Phoenix doesn't.

The only reference to SPDY in the codebase seems to be https://github.com/phoenixframework/phoenix/blob/5fc7eb829338dca3efd4a4d8f79f9e928d1bc34c/test/phoenix/socket_test.exs

Should I try to fork Phoenix and see how to add proper Cowboy call myself or am I missing something obvious?

Damir Bulic
  • 2,209
  • 1
  • 15
  • 7

2 Answers2

1

Old topic, but Cowboy 2.0 supports HTTP/2

And here some early attempts for The Cowboy 2 adapter for Phoenix

https://github.com/VoiceLayer/phoenix_cowboy2

and example app with http/2 support

https://github.com/voicelayer/phoenix_cowboy2_example

Pawel Dubiel
  • 18,665
  • 3
  • 40
  • 58
0

SPDY support has been removed from Cowboy2, and you should target HTTP/2 in the future if you aren't using a cdn.

Basically you'll need to use the latest PLug and Cowboy versions.

Here's a blog post about it https://chase.pursu.es/http-2-today-with-phoenix.html and another example app that leverages Webpack https://github.com/Ch4s3/http_2_today.

Chase
  • 2,748
  • 2
  • 23
  • 32