mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-04 00:23:43 +08:00
fix: fix lan-allowed-ips
does not take effect
This commit is contained in:
parent
20658f6eac
commit
9e57e7d29b
@ -36,7 +36,9 @@ func New(addr string, tunnel C.Tunnel, additions ...inbound.Addition) (*Listener
|
||||
}
|
||||
|
||||
func NewWithAuthenticate(addr string, tunnel C.Tunnel, authenticate bool, additions ...inbound.Addition) (*Listener, error) {
|
||||
isDefault := false
|
||||
if len(additions) == 0 {
|
||||
isDefault = true
|
||||
additions = []inbound.Addition{
|
||||
inbound.WithInName("DEFAULT-HTTP"),
|
||||
inbound.WithSpecialRules(""),
|
||||
@ -71,7 +73,7 @@ func NewWithAuthenticate(addr string, tunnel C.Tunnel, authenticate bool, additi
|
||||
t.SetKeepAlive(false)
|
||||
}
|
||||
}
|
||||
if len(additions) == 2 { // only apply on default listener
|
||||
if isDefault { // only apply on default listener
|
||||
if !inbound.IsRemoteAddrDisAllowed(conn.RemoteAddr()) {
|
||||
_ = conn.Close()
|
||||
continue
|
||||
|
@ -37,7 +37,9 @@ func (l *Listener) Close() error {
|
||||
}
|
||||
|
||||
func New(addr string, tunnel C.Tunnel, additions ...inbound.Addition) (*Listener, error) {
|
||||
isDefault := false
|
||||
if len(additions) == 0 {
|
||||
isDefault = true
|
||||
additions = []inbound.Addition{
|
||||
inbound.WithInName("DEFAULT-MIXED"),
|
||||
inbound.WithSpecialRules(""),
|
||||
@ -62,7 +64,7 @@ func New(addr string, tunnel C.Tunnel, additions ...inbound.Addition) (*Listener
|
||||
}
|
||||
continue
|
||||
}
|
||||
if len(additions) == 2 { // only apply on default listener
|
||||
if isDefault { // only apply on default listener
|
||||
if !inbound.IsRemoteAddrDisAllowed(c.RemoteAddr()) {
|
||||
_ = c.Close()
|
||||
continue
|
||||
|
@ -35,7 +35,9 @@ func (l *Listener) Close() error {
|
||||
}
|
||||
|
||||
func New(addr string, tunnel C.Tunnel, additions ...inbound.Addition) (*Listener, error) {
|
||||
isDefault := false
|
||||
if len(additions) == 0 {
|
||||
isDefault = true
|
||||
additions = []inbound.Addition{
|
||||
inbound.WithInName("DEFAULT-SOCKS"),
|
||||
inbound.WithSpecialRules(""),
|
||||
@ -59,7 +61,7 @@ func New(addr string, tunnel C.Tunnel, additions ...inbound.Addition) (*Listener
|
||||
}
|
||||
continue
|
||||
}
|
||||
if len(additions) == 2 { // only apply on default listener
|
||||
if isDefault { // only apply on default listener
|
||||
if !inbound.IsRemoteAddrDisAllowed(c.RemoteAddr()) {
|
||||
_ = c.Close()
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user