Hobby Developer, Streamer & Designer
Creating an IPv6 request is relatively simple
You have to create a http.client
with a custom transport
You only have to replace the DialContext
with tcp6
Code example:
webClient := http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: func(ctx context.Context, _, addr string) (net.Conn, error) {
dialer := net.Dialer{}
return dialer.DialContext(ctx, "tcp6", addr)
},
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
Expe...
...
Read more!