Access to underlying connection information added 0.16.1
For both HTTP/1 and HTTP/2 it is now possible to access connection information from a worker Process.get(Ace.HTTP.Connection). This allows inspection and verification of peer certificate. For example allowing a pure Elixir implementation of GRPC.
Better errors and child_specs added in 0.16.4 to help get started.
1. Callback errors
Raxx.ReturnError added to help debug callbacks. Now if a callback returns an invalid value the following error will be raise.
** (ReturnError) Invalid reaction from server module. Response must be complete or include update server state
e.g.
# Complete
Raxx.response(:ok)
|> Raxx.set_body("Hello, World!")
# New server state
response = Raxx.response(:ok)
|> Raxx.set_body(true)
{[response], new_state}
Actual value returned was
:ok
2. Server child_specs
If a module using Ace.HTTP.Service defines all the required server options it can be added to a supervision tree using a simpler child spec.
# lib/my_app/www.ex
defmodule MyApp.WWW do
use Ace.HTTP.Service, [port: 8080, cleartext: true]
end
# lib/my_app/application.ex
children = [
{MyApp.WWW, [%{config: foo}]}
# or
MyApp.WWW
]
0.18.0 release to separate streaming from simple interface.
Ace HTTP service must now explicitly implement Raxx.SimpleServer or Raxx.Server.
e.g.
defmodule MyApp.WWW do
use Ace.HTTP.Service, port: 8080, cleartext: true
use Raxx.SimpleServer
@impl Raxx.SimpleServer
def handle_request(_,_) do
response(:ok)
end
end
This changes are to facilitate adding middleware to Raxx.