From 67deac6d444541341d4578827918a83dcfc9ef1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 30 Aug 2023 17:39:03 +0800 Subject: [PATCH] Fix hysteria packet write --- transport/hysteria/protocol.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/transport/hysteria/protocol.go b/transport/hysteria/protocol.go index 77346a74..1e516f6d 100644 --- a/transport/hysteria/protocol.go +++ b/transport/hysteria/protocol.go @@ -526,11 +526,12 @@ func (c *PacketConn) NeedAdditionalReadDeadline() bool { } func (c *PacketConn) Read(b []byte) (n int, err error) { - return 0, os.ErrInvalid + n, _, err = c.ReadFrom(b) + return } func (c *PacketConn) Write(b []byte) (n int, err error) { - return 0, os.ErrInvalid + return c.WriteTo(b, c.destination) } func (c *PacketConn) Close() error {