add keepalive option for tunnel entrypoint

This commit is contained in:
ginuerzh
2024-10-14 23:09:07 +08:00
parent 0ffed81601
commit 5bba004324
7 changed files with 251 additions and 140 deletions
+12
View File
@@ -119,6 +119,18 @@ func (h *Sniffer) HandleHTTP(ctx context.Context, conn net.Conn, opts ...HandleO
}
ro := ho.RecorderObject
ro.HTTP = &xrecorder.HTTPRecorderObject{
Host: req.Host,
Proto: req.Proto,
Scheme: req.URL.Scheme,
Method: req.Method,
URI: req.RequestURI,
Request: xrecorder.HTTPRequestRecorderObject{
ContentLength: req.ContentLength,
Header: req.Header.Clone(),
},
}
if clientIP := xhttp.GetClientIP(req); clientIP != nil {
ro.ClientIP = clientIP.String()
}