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

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