CrowdHailer / raxx

Interface for HTTP webservers, frameworks and clients
https://hexdocs.pm/raxx
Apache License 2.0
402 stars 29 forks source link

setting up raxx for ssl #30

Closed CharlesOkwuagwu closed 7 years ago

CharlesOkwuagwu commented 7 years ago

Thanks for this simple web server library.

Please can you give an example of how to setup raxx as a secure server, i.e. with ssl. I have looked at your Elli and Cowboy adaptors, I cannot find where you handle https.

CrowdHailer commented 7 years ago

Hi,

I have not done this yet. It is on my too do list but I am working on supporting HTTP/2 as well. Still at the stage of proving that the raxx interface can handle all the usecases I need it for. After that the top priority is probably ssl.

I don't know your level but if you fancy tackling this yourself I am very happy to give you any clarification about the code that does exist

CharlesOkwuagwu commented 7 years ago

Thanks for the quick response.

I'll take a closer look at how you enabled http: and tcp: for cowboy, then compare against Plug's cowboy adapter implementation for https:

If I make any headway, i'll send a PR

CrowdHailer commented 7 years ago

Awesome. You are the first person to show up interested :+1:

I hope the cowboy adapter is up to date. I have been making most recent changes against the Ace Adapter. If you have any trouble setting up just HTTP with the cowboy adapter let me know because that should be a quick fix.

CharlesOkwuagwu commented 7 years ago

Nope, no luck setting up the cowboy example with the current version of cowboy: 1.1.2

The Elli setup on the other hand was really easy out of the box

CrowdHailer commented 7 years ago

Alright will check that out this evening.

CharlesOkwuagwu commented 7 years ago

https://github.com/CrowdHailer/raxx/blob/master/raxx_elli/lib/raxx/elli/handler.ex#L36

This can no longer be hardcoded as "http"

I am unable to find out how to pull the scheme off the elli_request

CrowdHailer commented 7 years ago

@CharlesOkwuagwu just pushed a patch version of :raxx_cowboy that uses the latest version of raxx and cowboy. Small tweets to the example and it now appears to be working

https://github.com/CrowdHailer/raxx/blob/master/example/cowboy_example/lib/cowboy_example.ex

Glad the elli adapter was easy. I think that better README's for the adapters are probably the most useful piece of documentation for me to get started on

CharlesOkwuagwu commented 7 years ago

I have Elli working with SSL :)

See this gist: https://gist.github.com/CharlesOkwuagwu/1eedf9eb5e3a212b51b658be78e6abf3

CharlesOkwuagwu commented 7 years ago

Also for consistency, can you make the cowboy example Supervised like the elli example.

mix new raxx_cowboy_demo --sup

Unable to modify it to be properly supervised.

CrowdHailer commented 7 years ago

Thanks for the gist that is great. If you want to create a whole project in the examples directory called elli_ssh or something that would be cool. That examples directory is a bit of a grab bag at the moment but it can be cleaned up later on

CrowdHailer commented 7 years ago

switching cowboy adapter so it can be used under a supervision tree. #31 includes some notes about how it might be done

CrowdHailer commented 7 years ago

Hi @CharlesOkwuagwu Does the release of raxx_cowboy 0.2.0 Handle your reason for opening this issue? If so I can close it.

I have also opened a new issue for documentation issue for setting up raxx and cowboy #34

CharlesOkwuagwu commented 7 years ago

yes we can close this. The changes we made in 0.2.0 seem adequate for now.