fix issue #883
This commit is contained in:
parent
b0bb26fc95
commit
aa8312a902
6
chain.go
6
chain.go
@ -154,9 +154,9 @@ func (c *Chain) dialWithOptions(ctx context.Context, network, address string, op
|
|||||||
ipAddr := address
|
ipAddr := address
|
||||||
if address != "" {
|
if address != "" {
|
||||||
ipAddr = c.resolve(address, options.Resolver, options.Hosts)
|
ipAddr = c.resolve(address, options.Resolver, options.Hosts)
|
||||||
}
|
if ipAddr == "" {
|
||||||
if ipAddr == "" {
|
return nil, fmt.Errorf("resolver: domain %s does not exists", address)
|
||||||
return nil, fmt.Errorf("resolver: domain %s does not exists", address)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout := options.Timeout
|
timeout := options.Timeout
|
||||||
|
@ -131,6 +131,7 @@ func (h *tcpDirectForwardHandler) Handle(conn net.Conn) {
|
|||||||
cc, err = h.options.Chain.Dial(node.Addr,
|
cc, err = h.options.Chain.Dial(node.Addr,
|
||||||
RetryChainOption(h.options.Retries),
|
RetryChainOption(h.options.Retries),
|
||||||
TimeoutChainOption(h.options.Timeout),
|
TimeoutChainOption(h.options.Timeout),
|
||||||
|
ResolverChainOption(h.options.Resolver),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Logf("[tcp] %s -> %s : %s", conn.RemoteAddr(), conn.LocalAddr(), err)
|
log.Logf("[tcp] %s -> %s : %s", conn.RemoteAddr(), conn.LocalAddr(), err)
|
||||||
@ -197,7 +198,12 @@ func (h *udpDirectForwardHandler) Handle(conn net.Conn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cc, err := h.options.Chain.DialContext(context.Background(), "udp", node.Addr)
|
cc, err := h.options.Chain.DialContext(
|
||||||
|
context.Background(),
|
||||||
|
"udp",
|
||||||
|
node.Addr,
|
||||||
|
ResolverChainOption(h.options.Resolver),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
node.MarkDead()
|
node.MarkDead()
|
||||||
log.Logf("[udp] %s - %s : %s", conn.RemoteAddr(), conn.LocalAddr(), err)
|
log.Logf("[udp] %s - %s : %s", conn.RemoteAddr(), conn.LocalAddr(), err)
|
||||||
|
Loading…
Reference in New Issue
Block a user