Skip to content

Commit

Permalink
Dial IPv6 stack (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe authored Feb 5, 2025
1 parent 33af906 commit f5b1c7f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fasthttp_http_client_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func newFasthttpHttpClientFactory() *fasthttpHttpClientFactory {

func (*fasthttpHttpClientFactory) Create(o httpClientOptions) httpClient {
d := func(address string) (net.Conn, error) {
return fasthttp.DialTimeout(address, tcpTimeout)
return fasthttp.DialDualStackTimeout(address, tcpTimeout)
}

if o.Proxy != "" {
Expand All @@ -36,7 +36,7 @@ func (*fasthttpHttpClientFactory) Create(o httpClientOptions) httpClient {
}

d = func(address string) (net.Conn, error) {
return td.DialTimeout(address, tcpTimeout)
return td.DialDualStackTimeout(address, tcpTimeout)
}
}

Expand All @@ -48,6 +48,7 @@ func (*fasthttpHttpClientFactory) Create(o httpClientOptions) httpClient {
InsecureSkipVerify: o.SkipTLSVerification,
},
Dial: d,
DialDualStack: true,
DisablePathNormalizing: true,
NoDefaultUserAgentHeader: true,
MaxResponseBodySize: o.MaxResponseBodySize,
Expand Down

0 comments on commit f5b1c7f

Please sign in to comment.