- control: outgoing HTTP requests didn't work if target IP is IPv6
This commit is contained in:
parent
a36630e5a8
commit
ddb1bc0fee
|
@ -341,7 +341,7 @@ func customDialContext(ctx context.Context, network, addr string) (net.Conn, err
|
||||||
var firstErr error
|
var firstErr error
|
||||||
firstErr = nil
|
firstErr = nil
|
||||||
for _, a := range addrs {
|
for _, a := range addrs {
|
||||||
addr = fmt.Sprintf("%s:%s", a.String(), port)
|
addr = net.JoinHostPort(a.String(), port)
|
||||||
con, err := dialer.DialContext(ctx, network, addr)
|
con, err := dialer.DialContext(ctx, network, addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if firstErr == nil {
|
if firstErr == nil {
|
||||||
|
|
Loading…
Reference in New Issue