Macaw.Live.Proxy.Plug (macaw_live v0.1.0)

Copy Markdown View Source

The asset proxy's plug (spec/06 §1.1), which a host mounts once with its configuration built at boot:

plug Macaw.Live.Proxy.Plug, Macaw.Live.Proxy.config!(live: MyApp.Macaw, origins: %{...})

It answers GET and HEAD of <at>/<component>/<route>/<digest>?<values> as Macaw.Live.Proxy.request/4 and answer/4 decide, every step a status and never a raise; every request whose path isn't below at passes on untouched. The upstream request is built fresh, carrying none of the viewer's headers, and no redirect is followed. HEAD answers the headers without the body. Copied from visualize's Visualize.TileProxy.Plug.

Summary

Functions

Answers a request below at, halting; passes every other request on.

A %Macaw.Live.Proxy{} as it is, or options for Macaw.Live.Proxy.config!/1.

Functions

call(conn, config)

Answers a request below at, halting; passes every other request on.

init(config)

A %Macaw.Live.Proxy{} as it is, or options for Macaw.Live.Proxy.config!/1.