Skip to content

Commit

Permalink
fix issue ginuerzh#883
Browse files Browse the repository at this point in the history
  • Loading branch information
ginuerzh committed Nov 16, 2022
1 parent b0bb26f commit aa8312a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ func (c *Chain) dialWithOptions(ctx context.Context, network, address string, op
ipAddr := address
if address != "" {
ipAddr = c.resolve(address, options.Resolver, options.Hosts)
}
if ipAddr == "" {
return nil, fmt.Errorf("resolver: domain %s does not exists", address)
if ipAddr == "" {
return nil, fmt.Errorf("resolver: domain %s does not exists", address)
}
}

timeout := options.Timeout
Expand Down
8 changes: 7 additions & 1 deletion forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (h *tcpDirectForwardHandler) Handle(conn net.Conn) {
cc, err = h.options.Chain.Dial(node.Addr,
RetryChainOption(h.options.Retries),
TimeoutChainOption(h.options.Timeout),
ResolverChainOption(h.options.Resolver),
)
if err != nil {
log.Logf("[tcp] %s -> %s : %s", conn.RemoteAddr(), conn.LocalAddr(), err)
Expand Down Expand Up @@ -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 {
node.MarkDead()
log.Logf("[udp] %s - %s : %s", conn.RemoteAddr(), conn.LocalAddr(), err)
Expand Down
2 changes: 1 addition & 1 deletion gost.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
)

// Version is the gost version.
const Version = "2.11.4"
const Version = "2.11.5"

// Debug is a flag that enables the debug log.
var Debug bool
Expand Down

0 comments on commit aa8312a

Please sign in to comment.