mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-14 05:11:17 +08:00
37 lines
518 B
Go
37 lines
518 B
Go
package sniffer
|
|
|
|
import "github.com/metacubex/mihomo/constant"
|
|
|
|
type Sniffer interface {
|
|
SupportNetwork() constant.NetWork
|
|
// SniffData must not change input bytes
|
|
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"
|
|
}
|
|
}
|