mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-06 22:29:55 +00:00
feat: Add LAN allowed and disallowed IP configurations (#861)
This commit is contained in:
@@ -71,6 +71,12 @@ 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()) {
|
||||
_ = conn.Close()
|
||||
continue
|
||||
}
|
||||
}
|
||||
go HandleConn(conn, tunnel, c, additions...)
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -62,6 +62,12 @@ 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()) {
|
||||
_ = c.Close()
|
||||
continue
|
||||
}
|
||||
}
|
||||
go handleConn(c, tunnel, ml.cache, additions...)
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -59,6 +59,12 @@ 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()) {
|
||||
_ = c.Close()
|
||||
continue
|
||||
}
|
||||
}
|
||||
go handleSocks(c, tunnel, additions...)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user