# `Macaw.Live.Proxy.Fetcher.Httpc`
[🔗](https://github.com/dcoai/macaw_live/blob/v0.1.0/lib/macaw/live/proxy/fetcher/httpc.ex#L1)

The default `Macaw.Live.Proxy.Fetcher` (spec/06 §1.6): OTP's `:httpc`, copied from
visualize's `Visualize.TileProxy.Fetcher.Httpc` and bounded.

  * it verifies the peer's certificate against the system's trusted roots
    (`:public_key.cacerts_get/0`) with hostname checking, or against `cacerts:` when its
    argument gives them (a test's own authority);
  * it follows no redirect: a redirect would leave the enabled origin, so a `3xx` is
    answered as it came and the proxy refuses it;
  * it streams the body and stops reading at `max_bytes:`, canceling the request,
    `{:error, :too_large}`, so an oversized body is never held whole;
  * it answers within `timeout:` milliseconds, `{:error, :timeout}`;
  * it sends exactly the headers it is given, and keeps no cookie.

Its argument is a keyword list, `[]` by default; `cacerts:` replaces the system's roots,
and `transport:`, `{module, arg}`, is what it performs its I/O through
(`Macaw.Live.Proxy.Fetcher.Httpc.Transport`), OTP's `:httpc` by default. A test gives
it a transport of its own, so the fetcher's own logic runs and no socket opens.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
