Skip to content

feat: automatically use EnvHttpProxyAgent for HTTP-proxy support#52

Open
mgraf158 wants to merge 1 commit into
Julien-R44:devfrom
mgraf158:dev
Open

feat: automatically use EnvHttpProxyAgent for HTTP-proxy support#52
mgraf158 wants to merge 1 commit into
Julien-R44:devfrom
mgraf158:dev

Conversation

@mgraf158
Copy link
Copy Markdown

This patch makes pino-loki automatically detect proxy settings from the environment variables (HTTP_PROXY / HTTPS_PROXY / NO_PROXY) using undici's EnvHttpProxyAgent. This ensures that logs are correctly sent in corporate network environments without requiring manual dispatcher injection.

Background:
Before this patch, there was no way to pass a proxy/agent to pino‑loki’s HTTP implementation.

Node’s native fetch() does not currently pick up undici.setGlobalDispatcher() when fetch is invoked — especially in Node 20/22 where fetch is backed by the built‑in undici.

This patch closes that gap and makes pino‑loki usable in proxied environments without workarounds.

This patch makes pino-loki automatically detect proxy settings from the
environment (HTTP_PROXY / HTTPS_PROXY / NO_PROXY) using undici's
EnvHttpProxyAgent. This ensures that logs are correctly sent in
corporate network environments without requiring manual dispatcher injection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant