View Source cowmachine_proxy (cowmachine v1.13.1)

Middleware to update proxy settings in the Cowboy Req.

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.

Functions

execute(Req, Env)

-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.

update_env(Req, Env)

-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.