- control: outgoing HTTP requests didn't work if target IP is IPv6

This commit is contained in:
Simon Zolin 2019-06-05 13:03:07 +03:00
parent a36630e5a8
commit ddb1bc0fee

View File

@ -341,7 +341,7 @@ func customDialContext(ctx context.Context, network, addr string) (net.Conn, err
var firstErr error
firstErr = nil
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)
if err != nil {
if firstErr == nil {