From ac9328633143cfee82ec4075f86fb33bf6eb73ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 7 Jan 2025 17:03:06 +0800 Subject: [PATCH] Fix leak in reality server --- common/tls/reality_server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/tls/reality_server.go b/common/tls/reality_server.go index 069f27b975..cf429815ee 100644 --- a/common/tls/reality_server.go +++ b/common/tls/reality_server.go @@ -194,3 +194,9 @@ func (c *realityConnWrapper) ConnectionState() ConnectionState { func (c *realityConnWrapper) Upstream() any { return c.Conn } + +// Due to low implementation quality, the reality server intercepted half close and caused memory leaks. +// We fixed it by calling Close() directly. +func (c *realityConnWrapper) CloseWrite() error { + return c.Close() +}