add range port support for forwarder node

This commit is contained in:
ginuerzh
2023-11-14 19:41:57 +08:00
parent ca1f44d93c
commit d7b7ac6357
12 changed files with 133 additions and 73 deletions

View File

@ -72,7 +72,7 @@ func (h *socks5Handler) handleUDP(ctx context.Context, conn net.Conn, log logger
WithLogger(log)
r.SetBufferSize(h.md.udpBufferSize)
go r.Run()
go r.Run(ctx)
t := time.Now()
log.Debugf("%s <-> %s", conn.RemoteAddr(), cc.LocalAddr())

View File

@ -63,7 +63,7 @@ func (h *socks5Handler) handleUDPTun(ctx context.Context, conn net.Conn, network
t := time.Now()
log.Debugf("%s <-> %s", conn.RemoteAddr(), pc.LocalAddr())
r.Run()
r.Run(ctx)
log.WithFields(map[string]any{
"duration": time.Since(t),
}).Debugf("%s >-< %s", conn.RemoteAddr(), pc.LocalAddr())