github.com/metacubex/mihomo@v1.18.5/constant/sniffer/sniffer.go (about) 1 package sniffer 2 3 import "github.com/metacubex/mihomo/constant" 4 5 type Sniffer interface { 6 SupportNetwork() constant.NetWork 7 // SniffData must not change input bytes 8 SniffData(bytes []byte) (string, error) 9 Protocol() string 10 SupportPort(port uint16) bool 11 } 12 13 const ( 14 TLS Type = iota 15 HTTP 16 QUIC 17 ) 18 19 var ( 20 List = []Type{TLS, HTTP, QUIC} 21 ) 22 23 type Type int 24 25 func (rt Type) String() string { 26 switch rt { 27 case TLS: 28 return "TLS" 29 case HTTP: 30 return "HTTP" 31 case QUIC: 32 return "QUIC" 33 default: 34 return "Unknown" 35 } 36 }