View Source cowmachine_proxy (cowmachine v1.12.1)

Middleware to update proxy settings in the Cowboy Req.

Link to this section Summary

Functions

Cowboy middleware, route the new request. Continue with the cowmachine, requests a redirect or return a 400 on an unknown host.
Update the environment based on the content of the request.

Link to this section Functions

-spec execute(Req, Env) -> Result
           when
               Req :: cowboy_req:req(),
               Env :: cowboy_middleware:env(),
               Result :: {ok, Req, Env} | {stop, Req}.
Cowboy middleware, route the new request. Continue with the cowmachine, requests a redirect or return a 400 on an unknown host.
-spec update_env(Req, Env) -> Result
              when
                  Req :: cowboy_req:req(),
                  Env :: cowboy_middleware:env(),
                  Result :: cowboy_middleware:env().
Update the environment based on the content of the request.