What is Cowboy?
Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols.
Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events.
In this talk, Gary Rennie, a Phoenix Core Team Member, looked at the changes in Cowboy 2 and how we can use it with Plug and Phoenix by using a custom Plug adapter. He then looked at how this can be done using a library and integrating it with Plug. The same technique was then applied to Phoenix, writing a custom handler in a library and then using it with Phoenix. He also explored how HTTP/2 can be used to build a new Phoenix Transport, allowing Phoenix PubSub to work with a bidirectional HTTP/2 channel, investigate how existing transports work, and what changes are required to implement a custom transport.
Learn more at developer's website.