diff --git a/cmd/sniproxy/sniproxy b/cmd/sniproxy/sniproxy deleted file mode 100755 index 1713712..0000000 Binary files a/cmd/sniproxy/sniproxy and /dev/null differ diff --git a/pkg/https.go b/pkg/https.go index 9316245..9c3ae5f 100644 --- a/pkg/https.go +++ b/pkg/https.go @@ -14,11 +14,14 @@ import ( // checks if the IP is the sniproxy itself func isSelf(c *Config, ip netip.Addr) bool { condition1 := ip.IsLoopback() || - ip.IsPrivate() || - ip == (netip.IPv4Unspecified()) || - ip == netip.MustParseAddr(c.PublicIPv4) || - ip == netip.MustParseAddr(c.PublicIPv6) + ip.IsPrivate() || ip == (netip.IPv4Unspecified()) + if c.PublicIPv4 != "" { + condition1 = condition1 || (ip == netip.MustParseAddr(c.PublicIPv4)) + } + if c.PublicIPv6 != "" { + condition1 = condition1 || (ip == netip.MustParseAddr(c.PublicIPv6)) + } if condition1 { return true }