Skip to content

Commit 4769f8c

Browse files
committed
ipn/auto: skip local proxies iff in remote-only mode
1 parent 858038a commit 4769f8c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

intra/ipn/auto.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (h *auto) dial(network, laddr, raddr string) (protect.Conn, error) {
136136
parallelDial := settings.AutoDialsParallel.Load()
137137

138138
if !parallelDial {
139-
rpns := []Proxy{pro, warp, amz, sep}
139+
rpns := []Proxy{exit, pro, warp, amz, exit64, sep}
140140
healthy := core.Map(
141141
core.FilterLeft(
142142
rpns,
@@ -159,13 +159,16 @@ func (h *auto) dial(network, laddr, raddr string) (protect.Conn, error) {
159159
// TODO: pinning IPs
160160
if len(healthy) <= 0 {
161161
// no healthy proxies; fail open
162-
all := core.Map(rpns, func(p Proxy) protect.RDialer {
162+
d := core.Map(rpns, func(p Proxy) protect.RDialer {
163163
if p == nil || core.IsNil(p) {
164164
return nil // nil proxies out
165165
}
166+
if remoteOnly && local(p.ID()) {
167+
return nil // local proxies out
168+
}
166169
return p.Dialer()
167170
})
168-
return dialAny(core.WithoutNils(all), network, laddr, raddr)
171+
return dialAny(core.WithoutNils(d), network, laddr, raddr)
169172
}
170173
return dialAny(healthy, network, laddr, raddr)
171174
}

0 commit comments

Comments
 (0)