chore: adjust sniffer constant
This commit is contained in:
31
constant/sniffer/sniffer.go
Normal file
31
constant/sniffer/sniffer.go
Normal 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"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user