add sniffer utility

This commit is contained in:
ginuerzh
2024-10-02 22:51:23 +08:00
parent 3c8add4b82
commit c42a44abb6
46 changed files with 1369 additions and 2723 deletions
+4 -1
View File
@@ -51,5 +51,8 @@ func isHTTP(s string) bool {
strings.HasPrefix(http.MethodPatch, s) ||
strings.HasPrefix(http.MethodHead, s[:4]) ||
strings.HasPrefix(http.MethodConnect, s) ||
strings.HasPrefix(http.MethodTrace, s)
strings.HasPrefix(http.MethodTrace, s) ||
// HTTP/2 connection preface
// PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n
strings.HasPrefix(s, "PRI *")
}