Skip to content

Commit

Permalink
feat(config): Use a proxy dialer
Browse files Browse the repository at this point in the history
  • Loading branch information
thib92 authored and Mongey committed Sep 14, 2023
1 parent 8f1482f commit 7bc0150
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

"github.com/IBM/sarama"
"golang.org/x/net/proxy"
)

type Config struct {
Expand All @@ -34,6 +35,9 @@ func (c *Config) newKafkaConfig() (*sarama.Config, error) {
kafkaConfig.Metadata.Full = true // the default, but just being clear
kafkaConfig.Metadata.AllowAutoTopicCreation = false

kafkaConfig.Net.Proxy.Enable = true
kafkaConfig.Net.Proxy.Dialer = proxy.FromEnvironment()

if c.saslEnabled() {
switch c.SASLMechanism {
case "scram-sha512":
Expand Down

0 comments on commit 7bc0150

Please sign in to comment.