From 7cfa5aed18218be8ff95f573cb65bfe77b853a5d Mon Sep 17 00:00:00 2001 From: FH0 <32861476+FH0@users.noreply.github.com> Date: Wed, 18 Mar 2020 19:25:22 +0800 Subject: [PATCH] fix udp broken --- proxy/dokodemo/dokodemo.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxy/dokodemo/dokodemo.go b/proxy/dokodemo/dokodemo.go index 22758505..46bfd668 100644 --- a/proxy/dokodemo/dokodemo.go +++ b/proxy/dokodemo/dokodemo.go @@ -164,6 +164,10 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in writer = &buf.SequentialWriter{Writer: tConn} tReader := buf.NewPacketReader(tConn) + notify, ok := conn.(buf.ActivityNotifiable) + if !ok { + panic("conn should implement ActivityNotifiable") + } requestCount++ tproxyRequest = func() error { defer func() { @@ -171,7 +175,7 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in timer.SetTimeout(plcy.Timeouts.DownlinkOnly) } }() - if err := buf.Copy(tReader, link.Writer, buf.UpdateActivity(timer)); err != nil { + if err := buf.Copy(tReader, link.Writer, buf.UpdateActivity(timer), buf.NotifyActivity(notify)); err != nil { return newError("failed to transport request (TPROXY conn)").Base(err) } return nil