fix recorder clientIP
This commit is contained in:
@@ -141,6 +141,7 @@ func (h *dnsHandler) Handle(ctx context.Context, conn net.Conn, opts ...handler.
|
|||||||
Time: start,
|
Time: start,
|
||||||
SID: string(ctxvalue.SidFromContext(ctx)),
|
SID: string(ctxvalue.SidFromContext(ctx)),
|
||||||
}
|
}
|
||||||
|
ro.ClientIP, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
|
|
||||||
log := h.options.Logger.WithFields(map[string]any{
|
log := h.options.Logger.WithFields(map[string]any{
|
||||||
"remote": conn.RemoteAddr().String(),
|
"remote": conn.RemoteAddr().String(),
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ func (h *redirectHandler) Handle(ctx context.Context, conn net.Conn, opts ...han
|
|||||||
Time: start,
|
Time: start,
|
||||||
SID: string(ctxvalue.SidFromContext(ctx)),
|
SID: string(ctxvalue.SidFromContext(ctx)),
|
||||||
}
|
}
|
||||||
|
ro.ClientIP, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
|
|
||||||
log := h.options.Logger.WithFields(map[string]any{
|
log := h.options.Logger.WithFields(map[string]any{
|
||||||
"remote": conn.RemoteAddr().String(),
|
"remote": conn.RemoteAddr().String(),
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ func (h *relayHandler) Handle(ctx context.Context, conn net.Conn, opts ...handle
|
|||||||
Time: start,
|
Time: start,
|
||||||
SID: string(ctxvalue.SidFromContext(ctx)),
|
SID: string(ctxvalue.SidFromContext(ctx)),
|
||||||
}
|
}
|
||||||
|
ro.ClientIP, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
|
|
||||||
log := h.options.Logger.WithFields(map[string]any{
|
log := h.options.Logger.WithFields(map[string]any{
|
||||||
"remote": conn.RemoteAddr().String(),
|
"remote": conn.RemoteAddr().String(),
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ func (h *socks4Handler) Handle(ctx context.Context, conn net.Conn, opts ...handl
|
|||||||
Time: start,
|
Time: start,
|
||||||
SID: string(ctxvalue.SidFromContext(ctx)),
|
SID: string(ctxvalue.SidFromContext(ctx)),
|
||||||
}
|
}
|
||||||
|
ro.ClientIP, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
|
|
||||||
log := h.options.Logger.WithFields(map[string]any{
|
log := h.options.Logger.WithFields(map[string]any{
|
||||||
"remote": conn.RemoteAddr().String(),
|
"remote": conn.RemoteAddr().String(),
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ func (h *socks5Handler) Handle(ctx context.Context, conn net.Conn, opts ...handl
|
|||||||
Time: start,
|
Time: start,
|
||||||
SID: string(ctxvalue.SidFromContext(ctx)),
|
SID: string(ctxvalue.SidFromContext(ctx)),
|
||||||
}
|
}
|
||||||
|
ro.ClientIP, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
|
|
||||||
log := h.options.Logger.WithFields(map[string]any{
|
log := h.options.Logger.WithFields(map[string]any{
|
||||||
"remote": conn.RemoteAddr().String(),
|
"remote": conn.RemoteAddr().String(),
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ func (h *ssHandler) Handle(ctx context.Context, conn net.Conn, opts ...handler.H
|
|||||||
Time: start,
|
Time: start,
|
||||||
SID: string(ctxvalue.SidFromContext(ctx)),
|
SID: string(ctxvalue.SidFromContext(ctx)),
|
||||||
}
|
}
|
||||||
|
ro.ClientIP, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
|
|
||||||
log := h.options.Logger.WithFields(map[string]any{
|
log := h.options.Logger.WithFields(map[string]any{
|
||||||
"remote": conn.RemoteAddr().String(),
|
"remote": conn.RemoteAddr().String(),
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ func (h *ssuHandler) Handle(ctx context.Context, conn net.Conn, opts ...handler.
|
|||||||
Time: start,
|
Time: start,
|
||||||
SID: string(ctxvalue.SidFromContext(ctx)),
|
SID: string(ctxvalue.SidFromContext(ctx)),
|
||||||
}
|
}
|
||||||
|
ro.ClientIP, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
|
|
||||||
log := h.options.Logger.WithFields(map[string]any{
|
log := h.options.Logger.WithFields(map[string]any{
|
||||||
"remote": conn.RemoteAddr().String(),
|
"remote": conn.RemoteAddr().String(),
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ func (h *forwardHandler) Handle(ctx context.Context, conn net.Conn, opts ...hand
|
|||||||
Time: start,
|
Time: start,
|
||||||
SID: string(ctxvalue.SidFromContext(ctx)),
|
SID: string(ctxvalue.SidFromContext(ctx)),
|
||||||
}
|
}
|
||||||
|
ro.ClientIP, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
|
|
||||||
log := h.options.Logger.WithFields(map[string]any{
|
log := h.options.Logger.WithFields(map[string]any{
|
||||||
"remote": conn.RemoteAddr().String(),
|
"remote": conn.RemoteAddr().String(),
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ func (h *unixHandler) Handle(ctx context.Context, conn net.Conn, opts ...handler
|
|||||||
Time: start,
|
Time: start,
|
||||||
SID: string(ctxvalue.SidFromContext(ctx)),
|
SID: string(ctxvalue.SidFromContext(ctx)),
|
||||||
}
|
}
|
||||||
|
ro.ClientIP, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
|
||||||
|
|
||||||
log := h.options.Logger.WithFields(map[string]any{
|
log := h.options.Logger.WithFields(map[string]any{
|
||||||
"remote": conn.RemoteAddr().String(),
|
"remote": conn.RemoteAddr().String(),
|
||||||
|
|||||||
Reference in New Issue
Block a user