mihomo/rule/base.go

34 lines
463 B
Go
Raw Normal View History

package rules
import (
"errors"
2021-07-01 22:49:29 +08:00
C "github.com/Dreamacro/clash/constant"
)
var (
errPayload = errors.New("payload error")
noResolve = "no-resolve"
)
func HasNoResolve(params []string) bool {
for _, p := range params {
if p == noResolve {
return true
}
}
return false
}
2021-07-01 22:49:29 +08:00
func findNetwork(params []string) C.NetWork {
for _, p := range params {
if p == "tcp" {
return C.TCP
} else if p == "udp" {
return C.UDP
}
}
return C.ALLNet
}