mihomo/constant/sniffer.go

29 lines
378 B
Go
Raw Normal View History

package constant
type Sniffer interface {
SupportNetwork() NetWork
SniffTCP(bytes []byte) (string, error)
Protocol() string
}
const (
TLS SnifferType = iota
)
var (
2022-05-02 05:10:18 +08:00
SnifferList = []SnifferType{TLS, HTTP}
)
type SnifferType int
func (rt SnifferType) String() string {
switch rt {
case TLS:
return "TLS"
2022-05-02 05:10:18 +08:00
case HTTP:
return "HTTP"
default:
return "Unknown"
}
}