1
0
mirror of https://github.com/MetaCubeX/mihomo.git synced 2025-09-19 20:15:59 +08:00
Files
mihomo/constant/sniffer/sniffer.go

30 lines
398 B
Go
Raw Permalink Normal View History

2022-05-02 08:46:24 +08:00
package sniffer
import "github.com/Dreamacro/clash/constant"
type Sniffer interface {
2022-05-02 08:46:24 +08:00
SupportNetwork() constant.NetWork
SniffTCP(bytes []byte) (string, error)
Protocol() string
}
const (
2022-05-02 08:46:24 +08:00
TLS Type = iota
HTTP
)
2022-06-09 21:08:46 +08:00
var List = []Type{TLS, HTTP}
2022-05-02 08:46:24 +08:00
type Type int
2022-05-02 08:46:24 +08:00
func (rt Type) String() string {
switch rt {
case TLS:
return "TLS"
2022-05-02 05:10:18 +08:00
case HTTP:
return "HTTP"
default:
return "Unknown"
}
}