chore: adjust sniffer constant

This commit is contained in:
MetaCubeX
2022-05-02 08:46:24 +08:00
parent ebbce4d061
commit 0cf539fb82
3 changed files with 21 additions and 14 deletions

View File

@ -0,0 +1,31 @@
package sniffer
import "github.com/Dreamacro/clash/constant"
type Sniffer interface {
SupportNetwork() constant.NetWork
SniffTCP(bytes []byte) (string, error)
Protocol() string
}
const (
TLS Type = iota
HTTP
)
var (
List = []Type{TLS, HTTP}
)
type Type int
func (rt Type) String() string {
switch rt {
case TLS:
return "TLS"
case HTTP:
return "HTTP"
default:
return "Unknown"
}
}