plausible / analytics

Simple, open source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.
https://plausible.io
GNU Affero General Public License v3.0
18.98k stars 1.02k forks source link

allow to configure Finch pools #4270

Open ruslandoga opened 1 week ago

ruslandoga commented 1 week ago

Changes

Closes #4269

This PR allows to configure Finch pools which are used by the Plausible HTTP client.

Example configuration to enable proxying:

import Config

if http_proxy = System.get_env("HTTP_PROXY") do
  # Plausible uses HTTPS, and our HTTP client (Mint) doesn't support HTTPS->HTTPS proxying
  # https://hexdocs.pm/mint/Mint.HTTP.html#connect/4-proxying recommends HTTP->HTTPS in this case
  %URI{scheme: "http", host: host, port: port} = URI.parse(http_proxy)
  config :plausible, Plausible.Finch, conn_opts: [proxy: {:http, host, port, _opts = []}]
end

Tests

Changelog

Documentation

Dark mode