Skip to content

Commit

Permalink
fix: drop if target host is 0.0.0.0 #29
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythologyli committed Sep 1, 2023
1 parent dfe4256 commit 84f6a41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ func ServeSocks5(ipStack *stack.Stack, selfIp []byte, bindAddr string, dnsServer
// in normal situation, addr must be a pure valid IP
// because we use `ZJUDnsResolve` to resolve domain name before call `Dial`
host := parts[0]
// TODO: figure out why host is 0.0.0.0
if host == "0.0.0.0" {
return nil, errors.New("Invalid host in address: " + addr)
}

port, err := strconv.Atoi(parts[1])
if err != nil {
return nil, errors.New("Invalid port in address: " + addr)
Expand Down

0 comments on commit 84f6a41

Please sign in to comment.