From 8a3711cf69c9eec11cf5beca47711bdbb0573aa2 Mon Sep 17 00:00:00 2001 From: NaLan ZeYu Date: Fri, 6 Mar 2026 22:59:45 +0800 Subject: [PATCH] socks: fix half-close from outbound side --- protocol/socks/lazy.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/protocol/socks/lazy.go b/protocol/socks/lazy.go index 1a1d61ca..5c5a023c 100644 --- a/protocol/socks/lazy.go +++ b/protocol/socks/lazy.go @@ -100,6 +100,13 @@ func (c *LazyConn) Upstream() any { return c.Conn } +func (c *LazyConn) CloseWrite() error { + if writeCloser, ok := c.Conn.(interface{ CloseWrite() error }); ok { + return writeCloser.CloseWrite() + } + return nil +} + type LazyAssociatePacketConn struct { AssociatePacketConn responseWritten bool