parse real client IP

This commit is contained in:
ginuerzh
2025-07-15 19:59:10 +08:00
parent d9a2f44a78
commit afcf4a5252
24 changed files with 232 additions and 74 deletions
+5
View File
@@ -665,6 +665,11 @@ func (h *httpHandler) dial(ctx context.Context, network, addr string) (conn net.
conn, err = h.options.Router.Dial(ctxvalue.ContextWithBuffer(ctx, &buf), network, addr)
if ro := ctx_internal.RecorderObjectFromContext(ctx); ro != nil {
ro.Route = buf.String()
if conn != nil {
ro.Src = conn.LocalAddr().String()
ro.Dst = conn.RemoteAddr().String()
}
}
return