From de5fa31d02603cbc346ad9b1cf73237c1117c2fc Mon Sep 17 00:00:00 2001 From: Laptop Date: Fri, 12 Dec 2025 21:21:20 +0200 Subject: [PATCH] yes of course --- lib/sc/init.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/sc/init.go b/lib/sc/init.go index bf2d970..eafed06 100644 --- a/lib/sc/init.go +++ b/lib/sc/init.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "fmt" + "log" "net/url" "os" "strings" @@ -56,12 +57,10 @@ var httpc = &fasthttp.HostClient{ IsTLS: true, Dial: (&fasthttp.TCPDialer{DNSCacheDuration: cfg.DNSCacheTTL}).Dial, MaxIdleConnDuration: cfg.MaxIdleConnDuration, - DialDualStack: true, } var genericClient = &fasthttp.Client{ - Dial: (&fasthttp.TCPDialer{DNSCacheDuration: cfg.DNSCacheTTL}).Dial, - DialDualStack: true, + Dial: (&fasthttp.TCPDialer{DNSCacheDuration: cfg.DNSCacheTTL}).Dial, } // var verRegex = regexp2.MustCompile(`^$`, 2) @@ -479,10 +478,14 @@ func GetSearchSuggestions(cid string, query string) ([]string, error) { // could probably make a generic function, whatever func init() { if cfg.SoundcloudApiProxy != "" { - d := fasthttpproxy.Dialer{Config: httpproxy.Config{HTTPProxy: cfg.SoundcloudApiProxy, HTTPSProxy: cfg.SoundcloudApiProxy}, TCPDialer: fasthttp.TCPDialer{DNSCacheDuration: cfg.DNSCacheTTL}} - httpc.Dial, _ = d.GetDialFunc(false) + d := fasthttpproxy.Dialer{Config: httpproxy.Config{HTTPProxy: cfg.SoundcloudApiProxy, HTTPSProxy: cfg.SoundcloudApiProxy}, TCPDialer: fasthttp.TCPDialer{DNSCacheDuration: cfg.DNSCacheTTL}, DialDualStack: true} + dialer, err := d.GetDialFunc(false) + if err != nil { + log.Println("[warning] failed to get dialer for proxy", err) + } - genericClient.Dial = httpc.Dial + genericClient.Dial = dialer + httpc.Dial = dialer } go func() { ticker := time.NewTicker(cfg.UserCacheCleanDelay)