fix traffic logging for socks5 udp

This commit is contained in:
ginuerzh
2025-02-18 17:30:36 +08:00
parent 11bca5bc3d
commit 2495b13053
8 changed files with 165 additions and 68 deletions
+2 -2
View File
@@ -136,8 +136,8 @@ func (h *socks5Handler) Handle(ctx context.Context, conn net.Conn, opts ...handl
if err != nil {
ro.Err = err.Error()
}
ro.InputBytes = pStats.Get(stats.KindInputBytes)
ro.OutputBytes = pStats.Get(stats.KindOutputBytes)
ro.InputBytes += pStats.Get(stats.KindInputBytes)
ro.OutputBytes += pStats.Get(stats.KindOutputBytes)
ro.Duration = time.Since(start)
if err := ro.Record(ctx, h.recorder.Recorder); err != nil {
log.Errorf("record: %v", err)