mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-12-27 12:35:39 +08:00
34 lines
463 B
Go
34 lines
463 B
Go
package rules
|
|
|
|
import (
|
|
"errors"
|
|
|
|
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
|
|
}
|
|
|
|
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
|
|
}
|