heimdall v0.6.8 Heimdall.Plug.ForwardRequest

This plug acts as a reverse proxy, it will forward any request to a configured location.

This location can be configured either as a default location by setting the applications :default_forward_url, or by providing it in opts to call/2 like call(conn, forward_url: url)

Summary

Functions

If the conn is not already in the :set state, call/2 will read the conn and all of its metadata and forward it to either the :forward_url specified in opts or the applications :default_forward_url

Init will reshape the data coming in from Heimdall.Marathon.BingeWatch, which comes in as a map with the key "forward_url" and comes out as a list with the atom :forward_url

Functions

build_url(base, conn)
call(conn, opts)

If the conn is not already in the :set state, call/2 will read the conn and all of its metadata and forward it to either the :forward_url specified in opts or the applications :default_forward_url.

Otherwise call will simple return the conn.

init(opts)

Init will reshape the data coming in from Heimdall.Marathon.BingeWatch, which comes in as a map with the key "forward_url" and comes out as a list with the atom :forward_url.