-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTPClient not support HTTP/HTTPS proxy #4269
Comments
👋 @HADB Where do the |
@ruslandoga Hi, thanks for replying. HTTP_PROXY and HTTPS_PROXY are environment variables used to specify proxy servers for HTTP and HTTPS traffic respectively. Many applications and libraries recognize and use these variables to route their network traffic through specified proxy servers, such as: |
I see. We might be able to provide support for these env vars later, but for now we can at least make proxying configurable via custom config files. I'll open a PR for that later today with an example configuration. |
@HADB would you be able to try out the image I built from #4270? Here're the changes you'd need to make: plausible:
- image: ghcr.io/plausible/community-edition:v2.1.1
+ image: ghcr.io/ruslandoga/plausible:build-allow-finch-config-9456444
+ volumes:
+ - ./my_config.exs:/app/my_config.exs my_config.exs import Config
# Plausible uses HTTPS for all outgoing requests, 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
config :plausible, Plausible.Finch, conn_opts: [proxy: {:http, _host = "some.proxy.com", _port = 1080, _opts = []}] Note that you would need to provide your own proxy host/port pair. There is also an example config in #4270 where host and port are extracted from HTTP_PROXY env var. + EXTRA_CONFIG_PATH=/app/my_config.exs |
@ruslandoga I have tried this image and it works as expected! Great job! Thanks a lot! |
Past Issues Searched
Issue is a Bug Report
Using official Plausible Cloud hosting or self-hosting?
Self-hosting
Describe the bug
First of all, thank you for the great work on this project!
Currently, the
HTTPClient
seems not support using HTTP or HTTPS proxies set via environment variables (HTTP_PROXY
andHTTPS_PROXY
). This functionality is important for users who need to route traffic through a proxy for various reasons, such as network restrictions or privacy concerns.In my case, I'm facing network restrictions while connecting to Google services or Gravartor avatars.
Expected behavior
The HTTPClient should respect the
HTTP_PROXY
/HTTPS_PROXY
environment variables and route HTTP/HTTPS requests through the specified proxy.Screenshots
No response
Environment
No response
The text was updated successfully, but these errors were encountered: