diff --git a/balancer.go b/balancer.go index 67245ea..6454aa9 100644 --- a/balancer.go +++ b/balancer.go @@ -37,7 +37,7 @@ func (r *roundRobin) DialContext(ctx context.Context, s *Subnet, network, addres dd := r.d.dialer dd.LocalAddr = ii.LocalAddr - return r.d.dialContext(&dd, ctx, "tcp", address) + return r.d.dialContext(&dd, ctx, network, address) } return nil, errors.New("(*roundRobin).DialContext: no suitale node found") } @@ -55,7 +55,7 @@ func (r *firstEnabled) DialContext(ctx context.Context, s *Subnet, network, addr dd := r.d.dialer dd.LocalAddr = ii.LocalAddr - return r.d.dialContext(&dd, ctx, "tcp", address) + return r.d.dialContext(&dd, ctx, network, address) } return nil, errors.New("(*firstEnabled).DialContext: no suitale node found") } diff --git a/dialer.go b/dialer.go index 66025b6..086b9b8 100644 --- a/dialer.go +++ b/dialer.go @@ -366,9 +366,9 @@ func (d *dialer) dialAddr(ctx context.Context, network, address string, addr net func (d *dialer) dialContext(nd *net.Dialer, ctx context.Context, network, address string) (net.Conn, error) { if h := d.testHookDialContext; h != nil { - return h(nd, ctx, "tcp", address) + return h(nd, ctx, network, address) } - return nd.DialContext(ctx, "tcp", address) + return nd.DialContext(ctx, network, address) } // UpdateInterface implements the Multidialer interface.