Skip to content

Commit

Permalink
fix: lan-allowed-ips does not take effect
Browse files Browse the repository at this point in the history
  • Loading branch information
xishang0128 committed Feb 5, 2024
1 parent 822ba5f commit 20658f6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions listener/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func NewWithAuthenticate(addr string, tunnel C.Tunnel, authenticate bool, additi
t.SetKeepAlive(false)
}
}
if len(additions) == 0 { // only apply on default listener
if inbound.IsRemoteAddrDisAllowed(conn.RemoteAddr()) {
if len(additions) == 2 { // only apply on default listener
if !inbound.IsRemoteAddrDisAllowed(conn.RemoteAddr()) {
_ = conn.Close()
continue
}
Expand Down
4 changes: 2 additions & 2 deletions listener/mixed/mixed.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func New(addr string, tunnel C.Tunnel, additions ...inbound.Addition) (*Listener
}
continue
}
if len(additions) == 0 { // only apply on default listener
if inbound.IsRemoteAddrDisAllowed(c.RemoteAddr()) {
if len(additions) == 2 { // only apply on default listener
if !inbound.IsRemoteAddrDisAllowed(c.RemoteAddr()) {
_ = c.Close()
continue
}
Expand Down
4 changes: 2 additions & 2 deletions listener/socks/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func New(addr string, tunnel C.Tunnel, additions ...inbound.Addition) (*Listener
}
continue
}
if len(additions) == 0 { // only apply on default listener
if inbound.IsRemoteAddrDisAllowed(c.RemoteAddr()) {
if len(additions) == 2 { // only apply on default listener
if !inbound.IsRemoteAddrDisAllowed(c.RemoteAddr()) {
_ = c.Close()
continue
}
Expand Down

0 comments on commit 20658f6

Please sign in to comment.