mihomo/constant/sniffer/sniffer.go
2023-10-19 18:30:20 +08:00

36 lines
475 B
Go

package sniffer
import "github.com/Dreamacro/clash/constant"
type Sniffer interface {
SupportNetwork() constant.NetWork
SniffData(bytes []byte) (string, error)
Protocol() string
SupportPort(port uint16) bool
}
const (
TLS Type = iota
HTTP
QUIC
)
var (
List = []Type{TLS, HTTP, QUIC}
)
type Type int
func (rt Type) String() string {
switch rt {
case TLS:
return "TLS"
case HTTP:
return "HTTP"
case QUIC:
return "QUIC"
default:
return "Unknown"
}
}