- 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
1 changed files with 1 additions and 1 deletions

View File

@ -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 {