Salemove.HttpClient.Middleware.Proxy (salemove_http_client v6.0.0)
Adds proxy server options to a request if either of the following conditions are met:
- Environment variable
http_proxy(orHTTP_PROXY) is set and requested protocol ishttp:// - Environment variable
https_proxy(orHTTPS_PROXY) is set and requested protocol ishttps://
Proxy options are not injected if either of the following conditions are met:
- Requested host is included into
no_proxy(orNO_PROXY) environment variable - Http client is configured with option
proxy: false
Finch limitation
Tesla.Adapter.Finch (the default adapter) does not support per-request
proxy options — Finch configures proxies at pool level. With the Finch adapter this
middleware is a no-op: the :proxy option and the proxy environment variables are
silently ignored. To proxy requests with Finch, configure the proxy on the pool:
config :salemove_http_client,
finch_pools: %{
default: [conn_opts: [proxy: {:http, "proxy.example.com", 3128, []}]]
}or use Tesla.Adapter.Hackney for clients that need per-request proxies.
Link to this section Summary
Functions
Callback implementation for Tesla.Middleware.call/3.
Link to this section Functions
Link to this function
call(env, next, opts)
Callback implementation for Tesla.Middleware.call/3.