golang force net/http client to use IPv4 / IPv6
问题 I' using go1.11 net/http and want to decect if a domain is ipv6-only. What did you do? I create my own DialContext because want I to detect if a domain is ipv6-only. code below package main import ( "errors" "fmt" "net" "net/http" "syscall" "time" ) func ModifiedTransport() { var MyTransport = &http.Transport{ DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, DualStack: false, Control: func(network, address string, c syscall.RawConn) error { if network ==