Skip to content

Commit

Permalink
Use twilight proxy
Browse files Browse the repository at this point in the history
rxdn committed Nov 9, 2024
1 parent 6e447b3 commit 42ac354
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/misconduct-detector/main.go
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/rxdn/gdl/cache"
"github.com/rxdn/gdl/objects/guild"
"github.com/rxdn/gdl/rest/request"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"net/http"
@@ -73,6 +74,14 @@ func main() {
// Build app context
appContext := must(buildAppContext(config, logger))

if config.Discord.ProxyUrl != nil {
logger.Info("Using proxy", zap.String("url", *config.Discord.ProxyUrl))
request.RegisterPreRequestHook(func(_ string, req *http.Request) {
req.URL.Scheme = "http"
req.URL.Host = *config.Discord.ProxyUrl
})
}

// Connect to Kafka
guildCh := make(chan guild.Guild, 10)
consumer := queue.NewConsumer(config, logger.With(zap.String("module", "consumer")), guildCh)

0 comments on commit 42ac354

Please sign in to comment.