@@ -190,7 +190,7 @@ func (h *auto) dial(network, laddr, raddr string) (protect.Conn, error) {
190
190
return nil , errNotPinned
191
191
}
192
192
// ip pinned to this proxy
193
- h . dialIfHealthy (exit , network , laddr , raddr )
193
+ return h . dialAlways (exit , network , laddr , raddr )
194
194
}
195
195
return h .dialIfReachable (exit , network , laddr , raddr )
196
196
}, func (ctx context.Context ) (protect.Conn , error ) {
@@ -203,7 +203,7 @@ func (h *auto) dial(network, laddr, raddr string) (protect.Conn, error) {
203
203
return nil , errNotPinned
204
204
}
205
205
// ip pinned to this proxy
206
- h .dialIfHealthy (pro , network , laddr , raddr )
206
+ return h .dialIfHealthy (pro , network , laddr , raddr )
207
207
}
208
208
209
209
// wait only if exit was used
@@ -247,7 +247,7 @@ func (h *auto) dial(network, laddr, raddr string) (protect.Conn, error) {
247
247
return nil , errNotPinned
248
248
}
249
249
// ip pinned to this proxy
250
- return h .dialIfHealthy (exit64 , network , laddr , raddr )
250
+ return h .dialAlways (exit64 , network , laddr , raddr )
251
251
}
252
252
253
253
select {
@@ -538,6 +538,17 @@ func (h *auto) dialIfReachable(p Proxy, network, local, remote string) (net.Conn
538
538
return h .dialIfHealthy (p , network , local , remote )
539
539
}
540
540
541
+ func (* auto ) dialAlways (p Proxy , network , local , remote string ) (net.Conn , error ) {
542
+ err := healthy (p )
543
+ if err != nil {
544
+ log .E ("auto dial; %s %s not ok; to %s; err: %v" , idstr (p ), network , remote , err )
545
+ }
546
+ if len (local ) > 0 {
547
+ return p .Dialer ().DialBind (network , local , remote )
548
+ }
549
+ return p .Dialer ().Dial (network , remote )
550
+ }
551
+
541
552
func (* auto ) dialIfHealthy (p Proxy , network , local , remote string ) (net.Conn , error ) {
542
553
if err := healthy (p ); err != nil {
543
554
return nil , fmt .Errorf ("auto dial; %s %s not ok; %v: %s" , p .ID (), network , err , remote )
0 commit comments