Skip to content

VoiceLayer/phoenix_cowboy2_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update, April 2018: Phoenix master supports Cowboy 2 now, so instead of using (the instructions from) this repository you can also do the following:

def deps do
  {:phoenix, github: "phoenixframework/phoenix", override: true},
  ...
   {:cowboy, "~> 2.3"}
end

PhoenixCowboy2Example

An example application for using phoenix_cowboy2.

The diff for upgrading from cowboy to cowboy2 is available in this commit:

https://github.com/voicelayer/phoenix_cowboy2_example/commit/437f9d1a98a408ce9bae7e46a18beb68d701fa17

Running

  • git clone git@gitgub.com:voicelayer/phoenix_cowboy2_example.git
  • cd phoenix_cowboy2_example
  • An SSL certificate is required as most browsers only support HTTP/2 when using HTTPS
  • openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout priv/server.key -out priv/server.pem
  • mix deps.get
  • npm install
  • mix phoenix.server
  • Navigate to https://localhost:4001

If the application is successfully running under HTTP/2 then you should see:

http2

Otherwise you should see:

not-http2

If you navigate to the http version of the site you will see the message above.

About

An example of using phoenix with cowboy 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published