add traffic sniffing for handler

This commit is contained in:
ginuerzh
2024-09-27 15:55:28 +08:00
parent dfb6cb95d0
commit 3c8add4b82
43 changed files with 4518 additions and 1839 deletions
+2 -1
View File
@@ -67,6 +67,7 @@ type HandlerRecorderObject struct {
Host string `json:"host"`
ClientIP string `json:"clientIP"`
ClientID string `json:"clientID,omitempty"`
Proto string `json:"proto,omitempty"`
HTTP *HTTPRecorderObject `json:"http,omitempty"`
TLS *TLSRecorderObject `json:"tls,omitempty"`
DNS *DNSRecorderObject `json:"dns,omitempty"`
@@ -78,7 +79,7 @@ type HandlerRecorderObject struct {
}
func (p *HandlerRecorderObject) Record(ctx context.Context, r recorder.Recorder) error {
if p == nil || r == nil {
if p == nil || r == nil || p.Time.IsZero(){
return nil
}