Skip to content
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

feat(config): Use a proxy dialer #347

Merged
merged 1 commit into from
Sep 14, 2023
Merged

feat(config): Use a proxy dialer #347

merged 1 commit into from
Sep 14, 2023

Conversation

thib92
Copy link
Contributor

@thib92 thib92 commented Sep 12, 2023

This PR creates a Go net/proxy Dialer with the FromEnvironment method and passes it in the Kafka client configuration under Net.Proxy. This allows users to configure a proxy client from environment variables (for example using ALL_PROXY). If no environment variable is set, the proxy will be transparent, making this PR backwards-compatible.

For more safety, we could place this code under a condition on an extra configuration key (use_proxy, or specify explicitly the proxy configuration in the provider configuration). However, I've inspired this from the PostgreSQL provider's proxy support

I've tested this manually on one of our projects that uses this provider. Specifying a ALL_PROXY=localhost:1080 environment variable makes the provider pas through the local proxy. Unsetting the variable makes it behave as before.

Fixes #147

@Mongey
Copy link
Owner

Mongey commented Sep 14, 2023

Thanks!

@Mongey Mongey merged commit 7bc0150 into Mongey:master Sep 14, 2023
3 of 4 checks passed
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.

Feature request: Proxying
2 participants